Application form

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28508
Joined: Sat Aug 16, 2003 7:36 am

Application form

Post by Extensions Robot »

Modification name: Application form
Author: JimA
Modification description: This form allows users to apply for a certain team positions. The applications are send to a hidden forum where the administrators can read them and see if the users are good enough for the position.
Modification version: 1.0.1
Tested on phpBB version: 3.0.5

Download file: application_form_1.0.1.zip
File size: 58.22 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extension Customisations Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Sep 14, 2020 12:37 pm, edited 10 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17314
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Application form

Post by DavidIQ »

Modification validated/released

Notes:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7816
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Application form

Post by JimA »

Thanks for the validation. :)

Adding fields
Okay, as promised, here is a tutorial on how to add fields to the Application form.
You need to have a little knowledge about how to make fields in a form in HTML.
  1. First, we add the language entries to the language files to make sure our text is visible.
    Open your language/en/mods/application.php file and look for )); at the bottom of the file.
    Then, add your language entry BEFORE the text you needed to find, on a blank line.

    It should look like the following:

    Code: Select all

        'APPLICATION_TEST'                => 'Test field',
    )); 
  2. All right, the text we are using for our brand new field is now defined, now we need to put the field into the form, in the template file. Open the appform_body.html file in the template folder of your style. Now it depends a little on what kind of field you want to make, most of the options are mentioned on the link I gave you above + the code you need to make them. For this example, we are going to make a simple text field, but it's easy to make another type of field, if you want to.

    This is code used to create the "Why should we choose you?" field, our field will be under that one.

    Code: Select all

    {L_APPLICATION_WHY}<br />
    <textarea rows="5" cols="50" name="why"></textarea>
    <br/><br/>
    After that, on a new line, put the following code for a simple textrow of 20 characters. Make sure you change the "test" in the language variable and line of code to the name of your field.

    Code: Select all

    {L_APPLICATION_TEST} <input type="text" name="test" /><br /><br />
  3. Everything is going well now, the field is added to the template file, so the users can see it. It is however not yet used in the script, so we are going to add it to the application.php file, so the script can see the text the user entered in the form.

    This line of code handles it:

    Code: Select all

    $apply_post     = sprintf($user->lang['APPLICATION_MESSAGE'], $user->data['username'], utf8_normalize_nfc(request_var('name', '', true)), $user->data['user_email'], request_var('postion', '', true), utf8_normalize_nfc(request_var('why', '', true))); 
    All of these arguments display the different information which has been entered to the script, and we are going to add our field to it too. In-line, look for this:

    Code: Select all

    utf8_normalize_nfc(request_var('why', '', true)) 
    After that code, we are (in the same line, so not on a new line!) adding the following:

    Code: Select all

    , request_var('test', '', true) 
    Which will result in the following. Again, don't forget to change the 'test' in the piece of code we added to the name of your new field.

    Code: Select all

    $apply_post     = sprintf($user->lang['APPLICATION_MESSAGE'], $user->data['username'], utf8_normalize_nfc(request_var('name', '', true)), $user->data['user_email'], request_var('postion', '', true), utf8_normalize_nfc(request_var('why', '', true)), request_var('test', '', true)); 
  4. Great, let's summarize what we have already done now. We have added a language variable to the language files to display the name of the field on the form, we have added the field to the template file so it will be displayed on the actual form page, and we have added a request_var to the application.php page so we can read the data given in to the field. Then there is one thing left that we have to do, we have to include the data we got in the post that is being submitted to the hidden forum so you as administrator can read what the user gave in.

    For that, we go back to the language files.
    Open your language/en/mods/application.php file and look for the APPLICATION_MESSAGE variable.

    Code: Select all

    'APPLICATION_MESSAGE'            => 'A new user has signed up by the application form, called [b] %1$s[/b].<br /><br />[b]Real name[/b]: %2$s<br />[b]E-mail address[/b]: %3$s<br />[b]Appling for[/b]: %4$s<br /><br />[b]Why would we choose him/her[/b]<br /> %5$s' 
    Due to the change we made in step 3 the data from our Test field is now accessible using %6$s.
    So the only thing we still need to do is add that to this language variable, and we are done.

    Code: Select all

    'APPLICATION_MESSAGE'            => 'A new user has signed up by the application form, called [b] %1$s[/b].<br /><br />[b]Real name[/b]: %2$s<br />[b]E-mail address[/b]: %3$s<br />[b]Appling for[/b]: %4$s<br /><br />[b]Why would we choose him/her[/b]<br /> %5$s<br /><br />[b]Testing field:[/b] %6$s', 
Screenshot:
Image

Enjoy! :)
Last edited by JimA on Tue Aug 18, 2009 5:34 pm, edited 3 times in total.
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
drankur
Registered User
Posts: 271
Joined: Sat Dec 22, 2007 4:16 am

Re: Application form

Post by drankur »

Hey I am very happy to see this MOD validated !! great add on
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Application form

Post by stokerpiller »

Thanks for making this, nice and simple :)

I am missing the form end tag in the html:

Code: Select all

</form>
isn't it supposed to be there?

Its not valid xhtml.
I am done with phpBB
fai1712
Registered User
Posts: 5
Joined: Fri Aug 14, 2009 1:44 pm

Re: Application form

Post by fai1712 »

Are there any other languages availabe than english and german? Spanish for example would be nice ;)

Greets
User avatar
tehwolf
Registered User
Posts: 8
Joined: Fri Aug 14, 2009 6:07 pm

Re: Application form

Post by tehwolf »

how do i use this for another template
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7816
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Application form

Post by JimA »

I'm glad to see it's appreciated, thanks for all the comments.
stokerpiller wrote:I am missing the form end tag in the html:

Code: Select all

</form>
isn't it supposed to be there?
Thanks. I fixed the issue, there were some others issues with xhtml too, which I got fixed. I'll include this into the next version.
fai1712 wrote:Are there any other languages availabe than english and german? Spanish for example would be nice ;)
Not yet. However, if you want to translate this modification, feel free to post your translation here or contact me by PM.
tehwolf wrote:how do i use this for another template
I currently only support prosilver. If the style you're using is based on prosilver, you'll be fine.
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: Application form

Post by imkingdavid »

Good MOD. I'll try installing it and report back in a bit! :)
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
RMcGirr83
Former Team Member
Posts: 21470
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Application form

Post by RMcGirr83 »

Congrats on the validation JimA!!
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: Application form

Post by imkingdavid »

Ok, I installed it and set it up correctly.

One thing to note is that it is incompatible with (i think) the Soft Delete MOD. Because any MOD that I install after that one that has to insert a new post returns a
topic_status cannot be NULL
error. I'm guessing that (even though "topic_status" is native to phpBB) that MOD adds it to the submit_post function or something.

To fix it, I did the following in application.php:
Find: Line 65

Code: Select all

	'enable_indexing'	=> true,
After, add: Line 66

Code: Select all

	'topic_status'		=> 0,
That makes it work properly. I'm not sure the affect of that line on the MOD if Soft Delete is not installed (although I wouldn't think it would make too big of a difference, imo).

Anyway, thanks for the MOD!
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Application form

Post by stokerpiller »

I have testet this mod with admin permissions, no problems.
The forum where the application is posted is the moderator forum where only moderators and admins have permissions.

When a standard user uses the app form they get this error:

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/functions_posting.php on line 2253: Undefined index: post_approved
[phpBB Debug] PHP Notice: in file /includes/functions_posting.php on line 2442: Undefined index: post_approved
The post get posted anyway, but it needs approval.

So there is something wrong with the permissions?
I am done with phpBB
User avatar
Metzle
Registered User
Posts: 113
Joined: Sat Mar 15, 2008 2:55 am
Location: Waiblingen-Neustadt (Germany)
Name: Daniel
Contact:

Re: Application form

Post by Metzle »

Great Mod! It works like a charme but had the same problems like stokerpiller :)
I solved the problem for the moment like this:

Just set the permissions for standard users in the hidden forum that they can write postings without approval. So you get the problem solved for the moment without codechanges but it's only a temporary solution i think.
Metzle
phpBB.de-Support-Team
No Support via PN/E-Mail/ICQ etc.
Allround-phpBB.de
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7816
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Application form

Post by JimA »

After some long testing, with the test user having no permissions on the forum at all, and the debug enabled, I could finally reproduce the error.

The best solution would be to automaticly approve the posts made using the Application form without having the need to go into the permissions.

Currently, the submit_post function doesn't support that, so I can't use it.
But, a change for that has been committed to the SVN and will be available in 3.0.6.

Until then, you can add the post_approved variable to the $data array. It won't do anything, it won't make the post suddently being approved, but it solves the error.

Open: application.php
Find:

Code: Select all

'enable_indexing'    => true, 
After, add:

Code: Select all

'post_approved'        => 1, 
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Application form

Post by stokerpiller »

Thanks for the fix JimA, working perfect.
I am done with phpBB
Locked

Return to “[3.0.x] MOD Database Releases”