* *

Contest

Badge Contest
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 12, 2010, 10:13

Login with username, password and session length

BlocWeb

Shoutbox

Last 10 Shouts:

Today at 00:09
Yeah, it's a very nice theme.  The cookie should maintain your selected width until you change it again while you're logged in.  Great job on this one Bloc. 8)
March 11, 2010, 23:27
now that is cool :)
March 11, 2010, 20:33
Well, after you are logged in, you should be able to select "Wide" at the very top and it should be wide again for you, as long as you are logged in.
March 11, 2010, 19:03
wow TP shrank
March 11, 2010, 18:53
Oh :D i missed this one ;) Thanks
March 11, 2010, 16:48
Sorry I mean at the very top of this page.
March 11, 2010, 15:54
Nolt...look at top left corner of forum page and click on 'wide'...
March 11, 2010, 15:08
Nice theme, but could be a litte bit wider I think :P
March 11, 2010, 13:38
Well if it was released and full of bugs what would people think then...
March 11, 2010, 10:45
so frustrating that the masses cant use it . Looks great but when can i have it "TP for smf2.0"

Show 50 latest

Recent Topics

Members
Stats
  • Total Posts: 246340
  • Total Topics: 25653
  • Online Today: 191
  • Online Ever: 1642
  • (July 09, 2008, 21:19)
Users Online

Author Topic: Generic Application Form  (Read 17636 times)

0 Members and 1 Guest are viewing this topic.

Offline sysd0wn

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Generic Application Form
« Reply #30 on: July 02, 2009, 21:16 »
Are there any known issues with this on TPv1.0 beta 4? I've been trying to get this to work. I pasted this code into a .php and called for it in an article, but it always says 'you need to be logged in' regardless of whether or not you are logged in. I have also attempted to put this straight into a PHP article, but then it won't even save. It returns a 500 Internal Server Error.

Any ideas?

Offline JPDeni

  • Professional slacker
  • TP Code
  • Hero Member
  • *
  • Posts: 4263
  • It seemed like a good idea at the time.
    • View Profile
    • MoreThanSpike
Re: Generic Application Form
« Reply #31 on: July 02, 2009, 21:29 »
Quote
I pasted this code into a .php and called for it in an article

Quote
I have also attempted to put this straight into a PHP article


I don't know what either one of those things means. You need to create a php article from within TP, paste the code into the article and save it.

No one has brought up any issues with beta 4. Are you able to save any other php file?
"Explain it to me like I was a three-year-old."

How to ask questions the smart way

Please read and follow the posting guidelines
Please do not PM for support unless specifically invited to do so.
It seemed like a good idea at the time.

Offline sysd0wn

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Generic Application Form
« Reply #32 on: July 02, 2009, 22:28 »
What I meant was, I saved the code in a file called "application.php" and changed my article type to External Article. This method always says "You must be logged in before you can apply".

For the second, I did exactly what you said - Create a php article, paste, save. And it gives me an internal server error.

I am able to save just plain text in a php article, but it seems to give me an error whenever I add code.

Offline JPDeni

  • Professional slacker
  • TP Code
  • Hero Member
  • *
  • Posts: 4263
  • It seemed like a good idea at the time.
    • View Profile
    • MoreThanSpike
Re: Generic Application Form
« Reply #33 on: July 02, 2009, 23:29 »
Quote
I saved the code in a file called "application.php" and changed my article type to External Article.


It wasn't designed for that. It was designed to go into a php article.

Quote
I am able to save just plain text in a php article, but it seems to give me an error whenever I add code.


Then your problem isn't with my code. The best thing to do is to start a topic for support with your php article problem.
"Explain it to me like I was a three-year-old."

How to ask questions the smart way

Please read and follow the posting guidelines
Please do not PM for support unless specifically invited to do so.
It seemed like a good idea at the time.

Offline Uthn

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Generic Application Form
« Reply #34 on: July 03, 2009, 02:56 »
Thanks the code JPDeni, works fine except for one little thing mainly due to the fact that i don't use English language in it.

French language uses 'special' characaters that cause some issues, here's an exemple

"c'est l'heure" becomes "c\'est l\'heure"

any clue ? :)

thanks

Offline JPDeni

  • Professional slacker
  • TP Code
  • Hero Member
  • *
  • Posts: 4263
  • It seemed like a good idea at the time.
    • View Profile
    • MoreThanSpike
Re: Generic Application Form
« Reply #35 on: July 05, 2009, 02:30 »
I'm sorry. I don't.
"Explain it to me like I was a three-year-old."

How to ask questions the smart way

Please read and follow the posting guidelines
Please do not PM for support unless specifically invited to do so.
It seemed like a good idea at the time.

Offline tragidy

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Generic Application Form
« Reply #36 on: July 06, 2009, 15:55 »
Hi,

First I would like to say thanks for the code, it works really well, however ive found one issue with this, however it should be fixable.

Here is an example of an array i used.

Code: [Select]
array(
'caption' =>      "<FONT COLOR=red>Age</font>",
'name' =>         "age",
'type' =>         "select",
'options' =>      "13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40+",
'defaultvalue' => "18",
'required' =>     1

If you note the color html or any html for that matter, ie; bold text

This all looks great on the form and looks great in the forum post however, if I go to modify the post exg; change topic from pending to accepted the body of the post becomes full of html that is out putted into html in the form of a php ' echo ' instead of keeping its coding.

I have attempted a solution with this line of your code.

Code: [Select]
if ($enable_post) {  //create new forum post with application

$postbody = 'Recruitment application has been made by  ' . $context['user']['name'] .'<br /><br/>';
foreach ($fielddef as $field) {
if ($field['type'] == 'heading')
$postbody .= $field['caption'] . '<br />';
else
$postbody = '[html]' . $field['caption'] . ': ' . $_REQUEST[$field['name']] . '[/html]<br />';

This would solve the issue upon editing however after the alteration of adding
Code: [Select]
[html] brackets after the application is posted it will only display the comments section.

I am using a stock copy of your code unaltered except for the alterations posted above obtained from the first page on this thread.

Any help or solutions you could provide would be great.

Thanks

Offline JPDeni

  • Professional slacker
  • TP Code
  • Hero Member
  • *
  • Posts: 4263
  • It seemed like a good idea at the time.
    • View Profile
    • MoreThanSpike
Re: Generic Application Form
« Reply #37 on: July 06, 2009, 16:31 »
Quote
This all looks great on the form and looks great in the forum post however, if I go to modify the post exg; change topic from pending to accepted the body of the post becomes full of html that is out putted into html in the form of a php ' echo ' instead of keeping its coding./quote]

That's because the code wasn't written to do that. If you want to change the outputted formatting, you should change it in the output part of the code, not the field definitions.

"Explain it to me like I was a three-year-old."

How to ask questions the smart way

Please read and follow the posting guidelines
Please do not PM for support unless specifically invited to do so.
It seemed like a good idea at the time.

Offline tragidy

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Generic Application Form
« Reply #38 on: July 06, 2009, 16:37 »
What exactly wasn't the code written to do?

You have in the php comments that html/color is allowed, but when posted it appears fine but to modify the post will display the pure html with no remorse or line breaks upon saving.

Code: [Select]
$postbody = '[html]' . $field['caption'] . ': ' . $_REQUEST[$field['name']] . '[/html]<br />';
Should resolve the issue however, the code will only echo the last array when modified.
« Last Edit: July 06, 2009, 16:39 by tragidy »

Offline JPDeni

  • Professional slacker
  • TP Code
  • Hero Member
  • *
  • Posts: 4263
  • It seemed like a good idea at the time.
    • View Profile
    • MoreThanSpike
Re: Generic Application Form
« Reply #39 on: July 06, 2009, 17:36 »
The code was not written to have html code included in the names of the fields.

My comments say the following:
Code: [Select]
$intro_form = "Put whatever introduction you want to appear at the top of the form here. You can add html. Be careful with quotation marks.";
$thanks_text = "This is what will appear after the form is submitted. You can use html. Be careful with quotation marks.";

Those comments apply to those variables only. The note about the caption says

Code: [Select]
Can include symbols and spaces.

Nothing about html. It's too complicated for a generic form, as you seem to have found out.

If you can find a way to resolve it, that's great, but it's not the way the code was intended.
"Explain it to me like I was a three-year-old."

How to ask questions the smart way

Please read and follow the posting guidelines
Please do not PM for support unless specifically invited to do so.
It seemed like a good idea at the time.