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)

rjmjr69 01-22-2007 06:44 AM

Can I add this as a link in the toolbar?

basilrath 01-22-2007 07:23 AM

Yes just link the php as normal

fluentdesigns 01-23-2007 10:34 PM

Im having trouble understanding how to creat a form? It says

2 - Edit the main hook (plug-in) - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!

but I have no idea what the heck that means. Plus in the description is says this hack is totally customizable via the admincp?

wintrmte 01-24-2007 04:55 PM

Great hack, but I'm having one problem.

The posts to a forum are being posted as Moderated. The forum permissions are set to be Non Moderated. How do I fix this?

Thanks!

Spinball 01-24-2007 07:12 PM

Quote:

Originally Posted by Abe1 (Post 1159546)
You need to add in the template a 'hidden' field so the f gets moved from the original page to the submit page.

I did. The f isn't being picked up the first time the script is run, so that the value of f in the form is null.

GrossKopf 01-28-2007 04:34 AM

Ok, I'm doing something wrong. I'm a total noob to vbulletin so please explain. I am getting the same results as this person:

https://vborg.vbsupport.ru/showpost....6&postcount=22

Can someone explain in step by step instructions what I need to do to remove the empty fields and get the fields I want to display?

Here's my actual form:

http://flotserver.net/forums/newthread.php?do=flotapp

lazytown 01-28-2007 10:11 AM

I'm starting to get spam through this, and as another user mentioned, the threads are marked for moderation for some reason.

I was hoping the captcha alternative (asking questions) could be applied to this mod.

-vissa

GrossKopf 01-28-2007 11:00 AM

I appologize if my question's been answered before, but 17 pages of questions was a lot to look through at 1:30am. I figured if I asked my question, maybe it would be answered before I have time to go through all 17 pages. If this is a common error, maybe a readme included with the hack could be written to address this problem?

Abe1 01-28-2007 11:46 AM

Quote:

Originally Posted by Spinball (Post 1166584)
I did. The f isn't being picked up the first time the script is run, so that the value of f in the form is null.

use 'forumid'. f gets changed to forumid

Abe1 01-28-2007 11:48 AM

Quote:

Originally Posted by fluentdesigns (Post 1166055)
Im having trouble understanding how to creat a form? It says


2 - Edit the main hook (plug-in) - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!

but I have no idea what the heck that means. Plus in the description is says this hack is totally customizable via the admincp?

hooks and plug-ins in the acp

Abe1 01-28-2007 11:49 AM

Quote:

Originally Posted by wintrmte (Post 1166511)
Great hack, but I'm having one problem.

The posts to a forum are being posted as Moderated. The forum permissions are set to be Non Moderated. How do I fix this?

Thanks!

check the forums permissions that the posts are going to.

Abe1 01-28-2007 11:51 AM

Quote:

Originally Posted by GrossKopf (Post 1168773)
Ok, I'm doing something wrong. I'm a total noob to vbulletin so please explain. I am getting the same results as this person:

https://vborg.vbsupport.ru/showpost....6&postcount=22

Can someone explain in step by step instructions what I need to do to remove the empty fields and get the fields I want to display?

Here's my actual form:

http://flotserver.net/forums/newthread.php?do=flotapp

you have to edit the template for this hack also. it's called 'form'

nymyth 01-30-2007 05:18 PM

Is there anyway to get rid of the message box at the bottom, the submit thread TEXT BOX....i just need the long question......not the piece under it...thanks

Peace

ps..N/M, just get rid of the $message area in the template.....

Spookysalem 01-31-2007 12:02 PM

I have just installed this, however before i click install. Which templates need editing and also i am confused regarding creating a custom form.

Thanks in advance for all help.

Abe1 01-31-2007 12:06 PM

Quote:

Originally Posted by Spookysalem (Post 1171243)
I have just installed this, however before i click install. Which templates need editing and also i am confused regarding creating a custom form.

Thanks in advance for all help.

template form

Spookysalem 01-31-2007 12:38 PM

Thanks found that, figured out how to create a new form. All i get when i go to it is a blank page.

sorted out the blank page thing just cannot get it to post in the correct forum or thread now.

nymyth 01-31-2007 01:22 PM

You have to make changes to the FORM HACK Plugin....

Its a little tricky. First thing is making changes to the Plugin, this is where your questions, email addys, username, etc must be edited. MAKE SURE U READ THIS AREA SPECIFICALLY. After the questions and stuff have been changed to your liking, then make the changes to the template.

Peace

hal05 02-03-2007 07:07 PM

Looking for this also. The mod is easy to use once you get the hang of it but I need to pass one of the variable as the title, anyone?:)

Quote:

Originally Posted by DarkDraco07 (Post 1126927)
how can i make it possible to use $post[fieldx] variable as my $posttitle? i would really like this to work. thx


Bonee70 02-06-2007 06:10 AM

Is there a chance we get this hack for 3.6.4 please?

blind-eddie 02-06-2007 04:45 PM

Quote:

Originally Posted by Bonee70 (Post 1175801)
Is there a chance we get this hack for 3.6.4 please?

It works in 3.6.4

Jelmertjee 02-06-2007 06:12 PM

this is really a great mod, i'm currently adjusting it to submit different kinds of content but have already completed one form which allows you to submit news, thanks very much abe!
The code is quite well commented already but i just wanted to do something in return so here is a quick overview on how to create a news submit form. The extra thing i've added here is the ability to insert a link to the source of the news (via a question in the submit form) and then a 'link' url at the end of the created thread. bit hard to understand, just take a look at the screenshots and you'll see what i mean, so let's get started with the code!

1.First of all install the mod, just follow the instructions.

2. then go to plugins> add plugin for the PHP code part. i created a plugin and named it 'submit_news', the name doesn't really matter, as long as it's understandable for you. set the hook to 'newthread_start'. Then paste this code into the Plugin PHP Code field:

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 = "submit_news";

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,5,6,7))) 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 = "newsform";
// Name of the answer template
$answertemplate = "newsformanswers";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "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 news! you're content will be reviewed by our staff, so it might take a short time before it shows up."; //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 = "Submit CG News";

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

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

$formpurpose = "Use the form below to submit Computer Graphics related news on tutorials, software releases and new technology. Your content will be reviewed so it will take a short time to show up, be sure to attach a small image as well.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 a descriptive, short title/heading:";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "direct link to news ";
$explain1 = "for example: http://www.enjoycg.com/article";

//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 filetype are you uploading?";

// The following choices must NOT have quotation marks
//$dropdownchoice1a = "image, .jpg, .gif, .png etc.";
//$dropdownchoice1b = ".3ds, .obj, .max";
//$dropdownchoice1c = "other";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 describe your news in short, one or two sentences.";
$vbtextexplain = "a link to the news is not neccessary, it will be added automatically.";

}


IMPORTANT: i didn't change the main script, you should insert it after this code, you can find the code in the original 'form hack' plugin.

i'm not going to explain all of the changes but they are actually fairly simple, many questions were just taken out because i didn't need them, it's important to use this name though, so it matches when you want to load the form later: $formname = "submit_news";

Jelmertjee 02-06-2007 06:13 PM

here's part 2 of the explanation, it was too long to fit in one post!

4.Alright, that's all for the code, now we need to adjust the templates, you can copy the code and after that make adjustments to it yourself.
first the 'newsform' template, go to 'styles & templates> all template options' and select 'new template' name the template 'newsform'.
The name 'newsform' is important, because this links back to the php code part!

this will provide the look of the submit form, here's the entire code:
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $formtitle</title>
</head>
<body>
$header
$navbar

<!-- main -->
<if condition="$preview">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
                Preview
        </td>
</tr>
<tr>
        <td class="alt2">
$preview
</td>
</tr>
</table>
</if>

<br />
<form name="vbform" action="newthread.php" method="post"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(0, $vboptions[postminchars])"</if>>
<input type="hidden" value="$formname" name="do" />
<input type="hidden" value="submit" name="action" />

<input type="hidden" name="posthash" value="$posthash" />
<input type="hidden" name="poststarttime" value="$poststarttime" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat" colspan="3">
                $vboptions[bbtitle] - $formtitle
        </td>
</tr>
<tr>
        <td class="panelsurround" align="center" colspan="3">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]">
                        <fieldset class="fieldset" style="margin:0px">
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td>
                                                $formpurpose

                                        </td>
                                </tr>
                </table>
        </fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr>
        <td class="alt2" colspan="3">
          <b>$normalquestion1</b>     
          <input type="text" size="30" value="$normalanswer1" name="normalanswer1" />
        </td>
</tr>

<tr>
<td class="alt2" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt2" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
$explain1</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" value="$answer1" name="answer1" /></td>
</tr>


<tr>
<td class="alt2" valign="middle" colspan="3">
<b>$vbtextquestion</b><br />
$vbtextexplain
<div align="center">
<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>

it's pretty much the same as the original template, i've only deleted the bits we didn't need for submitting news.

5.Now the final template called 'newsformanswers' (again, the name is important, it's linked to the PHP code part!) use the same procedure as with the other template but now use this simple code instead:
Code:

$vbtextanswer

link

yes, that's really all there is to it!!! the $vbtextanswer is the text filled out and is the main description of the news, the $answer1 variable is the actual link to the news taken from the submitted form, i've used the BB code URL tag and named the text inbetween 'link', of course you can change that to anything you want, for example: "more", "source" , "view news here".

Alright, i know this explanation is quite simple but if you use the exact same code it should work fine, i hope you found this usefull, if you have any questions don't hesitate.

I've taken this a bit further myself by using vbadvanced CMPS, it's free and quite good for what i need, the submitted news goes into a forum, and the CMPS then takes that data from the forum and posts it in a news layout on a different page.

One thing i would like to implement is a sort of browse button to directly add attachments, any idea if that's possible?

Spinball 02-06-2007 06:58 PM

Quote:

Originally Posted by Abe1 (Post 1168931)
use 'forumid'. f gets changed to forumid

That did it - all working in conjuncton with your newthread button hack, thanks.

lazytown 02-07-2007 01:28 AM

Love the mod, but I'm now getting crazy spam through this. I use it as a "contact us" which gets posted in a mod-only section. PLEASE -- is there any way to add Captcha or some other human-entry question that must be answered correctly to prevent the spam?

Thanks
-vissa

Bonee70 02-07-2007 02:16 PM

Quote:

Originally Posted by blind-eddie (Post 1176092)
It works in 3.6.4

Unfortunately not for me. As soon as I want to edit the main hook I get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, service@xxxxxxdotde and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

bada_bing 02-07-2007 03:00 PM

Is this hack use usergroup permissions?

nymyth 02-07-2007 04:48 PM

Quote:

Originally Posted by Bonee70 (Post 1176793)
Unfortunately not for me. As soon as I want to edit the main hook I get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, service@xxxxxxdotde and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Bonee, are you using wordpad or some text editing tool to edit the plugin...i had that same error when i used a editing tool.....after which i justed edited the plugin inside of vbulletin and everything worked fine...

Peace

dutchbb 02-07-2007 06:07 PM

The attachments are a great improvement but do you think it's possible to also include the thread rating (stars) in the form?

I'm using it as a 'write a review' form and it would be nice to have the rating included in the database instead of using static content.

Bonee70 02-07-2007 09:40 PM

Quote:

Originally Posted by nymyth (Post 1176893)
Bonee, are you using wordpad or some text editing tool to edit the plugin...i had that same error when i used a editing tool.....after which i justed edited the plugin inside of vbulletin and everything worked fine...

Peace

I get this error message when I try to edit the plugin inside of vbulletin ("newthread_start" in the plugin manager ). According to the install instructions I should edit it within vbulletin and not with a text editor.

Am I just stupid or what do I need to change to get this to work?

:confused:

ryansmith 02-08-2007 03:21 PM

Is there a way to make the $posttitle one of the inputs? For instance, if I create a field called "Title" and allow a user to type a title, how do I make that show up as the actual $posttitle?

EDIT: I figured it out :) It works great now.

hal05 02-08-2007 09:54 PM

That is the only thing that is missing for us. :)

Quote:

Originally Posted by ryansmith (Post 1177620)
Is there a way to make the $posttitle one of the inputs? For instance, if I create a field called "Title" and allow a user to type a title, how do I make that show up as the actual $posttitle?

EDIT: I figured it out :) It works great now.


GBSteve 02-09-2007 02:48 AM

man people this mod isn't that hard to grasp. you add your variables to parts 1 and 2 and define ur question variables on the plugin. your questions form is friggin html - not that tricky. if u want something to show up, you type it. if its a variable from the plugin, you call it with a dollar sign ($). on the answer form, its just bbcode - you wanna answer to show up you call it with the $ and if you want to bold it you friggin' bbcode bold the thing.

as far as the 5-star ratings, why would you rate a form that isn't filled out? you would only need to rate the data on the form, which lucky for everyone who is using this hack, the data is posted as either a thread or a post and if you've got the rating system turned on, well presto chango you can rate the threads/posts that submitting your form creates.

hal05 - $posttitle = "$title". make sure you put title in part 1 and 2 and change the code below part 2 where it says by default $posttitle = $formtitle.

Gandiel 02-09-2007 04:30 PM

Quote:

Originally Posted by GBSteve (Post 1178044)
and if you want to bold it you friggin' bbcode bold the thing.

Uhhh.. it's not as simple as that, GBSteve... at least not in my experience.

If you want to [.B][/B.] your questions, for example, you'll have to put a space inbetween the [.B] tag and your variable (and also at the end before the closing [/B.] tag. Otherwise, you'll get a parse error when you try to save it.

So, your bolded question would look like this: [.B]<space>$variable<space>[/B.]

Furthermore, not all BBCode gives a parse error if you don't do this. i.e. [.SIZE=4][/SIZE.] works fine without the <space>.


Note: The periods or dots are put in the above code so I could get them to appear here.

molieman 02-12-2007 12:13 PM

I would love to have this work on my site, I can see lot's of uses. Excellent MOD!!!!

I have to be honest, the instructions are beyond me.... I've tried to install this and followed the instructions.... Simple for the not so newbies, but, again, beyond me.

I'll keep checking for explicate, understandable instructions (at least for me) :)

Bonee70 02-12-2007 12:31 PM

So can anyone help me? I still can't get this to work and get the "internal server error" message....

NightPhoenix 02-13-2007 04:05 AM

I have a problem here.... Here's my form http://www.shuhalo.com/home/newthread.php?do=form

It looks just how I want it, BUT it won't post the info right... It posts the radio buttons first and only 3 of the questions.

I want it to post the same order as the form is laid out.

Kiint 02-13-2007 08:41 AM

I've been getting the following displayed on any form that has been submitted:

<!-- BEGIN TEMPLATE: applyanswers -->

and at the bottom:

<!-- END TEMPLATE: applyanswers -->

Where can I remove these so they do not show up on any post made by the form? I've been looking through the templates and plugin code but can't find them.

Please help.

fviper 02-13-2007 10:48 AM

Hey NightPhoenix,

It sounds like you need to go to your StyleManager in the admincp, and modify the "formanswers" template that's created by default. I had the same problem, and all that's needed is to place the desired variables on that template in the order you want them in, and voila. I use my page for recruiting too - lol. http://www.adversaryguild.com/forums...ad.php?do=form

One thing i'd personally like to see is posting the answers in a tabular format similar to the manner in which the questions are given. I've been able to semi get what I want by putting html code on the formanswers template. The only real trick to using html code on that page is that you have to butt it all up against each other on a single line - or as close as you can get it. If you don't have it on a single line, for every line of code you have on that page, you will get a blank space on the output page. Perhaps there's a setting he has to allow html code for the output somewhere - not sure.

Also, if anyone has figured out a way to get one of the dropdown answers to be a variable for the replythread or forum post id, i'd greatly appreciate some insight. I see where he suggests using "do=form&f=1" in the comments field, but i'm not certain how to define that in the html side to post there.

Thanks!

MidnightShadows 02-13-2007 03:34 PM

I love this hack :D but I have an issue LOL

I installed it, created a nice looking form and decided I wanted a second form. Did was said in the instructions but then I went back to check up on both forms and neither worked. So I disabled the new form and voila my old form worked again. Whatever I try it doesn't seem to work with two forms. What am I doing wrong? Am I missing something?

Thanks in advance :D

eta It's solved...

fviper 02-13-2007 04:28 PM

Hey All,

It seems like this is a common question... What I have is a dropdown menu that based on the user's selection, I would like it to be able to reply to an already existent thread. Here's my code thus far:

Code:

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";
$formreplythreadid = "41";
//EXISTING THREAD ID FOR FORM TO REPLY IN

Code:

//////////////////////////////////////////////////////
$dropdownquestion1 = "CLASS";
// The following choices must NOT have quotation marks
$dropdownchoice1a = "Please Select One";
$dropdownchoice1b = "Warrior";
$dropdownchoice1c = "Rogue";
$dropdownchoice1d = "Paladin";
$dropdownchoice1e = "Druid";
$dropdownchoice1f = "Priest";
$dropdownchoice1g = "Mage";
$dropdownchoice1h = "Warlock";
$dropdownchoice1i = "Shaman";
//////////////////////////////////////////////////////

That was from the plugin. All of the variables are properly declared, and the form posts its reply as it should, but only to a staticly set thread.

Here's what I have from my template:

Code:

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:
</td>
<td class="alt1" 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>
<option value="$dropdownchoice1c" <if condition="$dropdownchoice1c == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1c</option>
<option value="$dropdownchoice1d" <if condition="$dropdownchoice1d == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1d</option>
<option value="$dropdownchoice1e" <if condition="$dropdownchoice1e == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1e</option>
<option value="$dropdownchoice1f" <if condition="$dropdownchoice1f == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1f</option>
<option value="$dropdownchoice1g" <if condition="$dropdownchoice1g == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1g</option>
<option value="$dropdownchoice1h" <if condition="$dropdownchoice1h == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1h</option>
<option value="$dropdownchoice1i" <if condition="$dropdownchoice1i == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1i</option>
</select></td>
</tr>

I have tried putting conditional statements in on the plugin side and am met with "Cannot use a scalar value as an array". I can only assume I am not using array-based variables there properly. Looking at the last snippet of code, where in the option value can I assign "do=form&t=1" based on each selection?

Example: If they select dropdownchoice 1b from here, the corresponding thread that $formreplythreadid would be to 34, 1c would go to 31, so on and so forth.

Any thoughts? Sample code would be great if anyone can provide any :)


All times are GMT. The time now is 02:42 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.02112 seconds
  • Memory Usage 1,958KB
  • 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
  • (14)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