Page 1 of 1

Application.php by JimA

Posted: Fri Dec 23, 2016 1:41 pm
by Duesama
Hi I am using the application version 1.0.1 for for phpbb 3.0.14 and I am getting the errors

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/language/en/mods/application.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/language/en/mods/application.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/language/en/mods/application.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/language/en/mods/application.php:1)

Application.php

Code: Select all

<?php
/**
* @package application.php
* @copyright (c) JimA http://beta-garden.com 2009
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
/**
added
*/
include($phpbb_root_path . 'includes/functions_url_matcher.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/application');

// You need to login before being able to send out an application
if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN_APPLICATION_FORM']);
}

include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

// Let's set the configuration, this is the ID of the forum where the post goes to
$forumid_send = 44;

$submit = (isset($_POST['submit'])) ? true : false;

	if ($submit)
	{

// Setting the variables we need to submit the post to the forum where all the applications come in
$apply_subject  = sprintf($user->lang['APPLICATION_SUBJECT'], $user->data['username']);
$apply_post     = sprintf($user->lang['APPLICATION_MESSAGE'], $user->data['username'], utf8_normalize_nfc(request_var('name', '', true)),
 utf8_normalize_nfc(request_var('class', '', true)),
 utf8_normalize_nfc(request_var('aa', '', true)),
 utf8_normalize_nfc(request_var('alaran', '', true)),
 utf8_normalize_nfc(request_var('magelo', '', true)),
 utf8_normalize_nfc(request_var('prevguild', '', true)),
 utf8_normalize_nfc(request_var('crossserver', '', true)),
 utf8_normalize_nfc(request_var('experience', '', true)),
 utf8_normalize_nfc(request_var('why', '', true)),
 utf8_normalize_nfc(request_var('who', '', true)),
 utf8_normalize_nfc(request_var('what', '', true)),
 utf8_normalize_nfc(request_var('schedule', '', true)),
 utf8_normalize_nfc(request_var('owner', '', true)),
 utf8_normalize_nfc(request_var('access', '', true)),
 utf8_normalize_nfc(request_var('other', '', true)),
 utf8_normalize_nfc(request_var('any', '', true)), $user->data['user_email']);

// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = ''; 

generate_text_for_storage($apply_post, $uid, $bitfield, $options, true, true, true);

$data = array( 
	'forum_id'		=> $forumid_send,
	'icon_id'		=> false,

	'enable_bbcode'		=> true,
	'enable_smilies'	=> true,
	'enable_urls'		=> true,
	'enable_sig'		=> true,

	'message'		=> $apply_post,
	'message_md5'	=> md5($apply_post),
				
	'bbcode_bitfield'	=> $bitfield,
	'bbcode_uid'		=> $uid,

	'post_edit_locked'	=> 0,
	'topic_title'		=> $apply_subject,
	'notify_set'		=> false,
	'notify'			=> false,
	'post_time' 		=> 0,
	'forum_name'		=> '',
	'enable_indexing'	=> true,
);

// Sending the post to the forum set in configuration above
submit_post('post', $apply_subject, '', POST_NORMAL, $poll, $data);

$message = $user->lang['APPLICATION_SEND'];
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
}

page_header($user->lang['APPLICATION_PAGETITLE']);

$template->assign_vars(array(
	'PROCESS_APPFORM'	=> append_sid("{$phpbb_root_path}application.$phpEx"),
	));
	
$template->set_filenames(array(
    'body' => 'appform_body.html',
));

page_footer();

appform_body.html

Code: Select all

<!-- INCLUDE overall_header.html -->

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <div class="content">
      
        <h2>{L_APPLICATION_PAGETITLE}</h2>
        
        <span style="font-size: 1.3em;">{L_APPLICATION_WELCOME_MESSAGE}<br /><br /><br />
       
        <form method="post" action="{PROCESS_APPFORM}" id="appform"> 
        {L_APPLICATION_CHARNAME} <input type="text" name="name" /><br />
        {L_APPLICATION_CLASS} <input type="text" name="class" /><br />
        {L_APPLICATION_AA} <input type="text" name="aa" /><br />
        <!-- {L_APPLICATION_ALARAN} <input type="text" name="alaran" /><br /> -->
        {L_APPLICATION_MAGELO} <br />
        <textarea name="magelo" cols="50" rows="1" >...</textarea><br />

        {L_APPLICATION_PREVGUILDS} <br />
        <textarea rows="3" cols="50" name="prevguild"></textarea><br />

        {L_APPLICATION_CROSSSERVER} <br />
        <textarea rows="2" cols="50" name="crossserver"></textarea><br />

        {L_APPLICATION_EXPERIENCE} <br />
        <textarea rows="3" cols="50" name="experience"></textarea><br />

        {L_APPLICATION_WHY} <br />
        <textarea rows="3" cols="50" name="why"></textarea><br />

        {L_APPLICATION_WHO} <br />
        <textarea rows="3" cols="50" name="who"></textarea><br />

        {L_APPLICATION_WHAT} <br />
        <textarea rows="3" cols="50" name="what"></textarea><br />

        {L_APPLICATION_SCHEDULE} <input type="text" name="schedule" /><br />
        {L_APPLICATION_OWNER} <br />
        <textarea rows="3" cols="50" name="owner"></textarea><br />

        {L_APPLICATION_ACCESS} <br />
        <textarea rows="3" cols="50" name="access"></textarea><br />

        {L_APPLICATION_OTHER} <br />
        <textarea rows="3" cols="50" name="other"></textarea><br />

        {L_APPLICATION_ANY}<br />
        <textarea rows="3" cols="50" name="any"></textarea><br />


        </select>
        <br /><br />
        
        <br/><br/>
        
        <input type="submit" name="submit" id ="submit" value="{L_SUBMIT}" class="button1" />
       
        </span>
      
   </div>
What can I do to get rid of errors

Re: Application.php by JimA

Posted: Fri Dec 23, 2016 1:54 pm
by JimA
Hi, welcome to phpBB.com! :)

Support for modifications is given in a specific area in our Customisation Database, which for the Application Form MOD is over here. Could you please post your question there and add the code of the language file language/en/mods/application.php as well?

Re: Application.php by JimA

Posted: Fri Dec 23, 2016 2:05 pm
by RMcGirr83
language/en/mods/application.php:1
You posted all files except for the language file which is the one that is tossing the error.

You have used an editor that has inserted what is known as a BOM. Use a strict text editor, like notepad++ (NOT windows notepad), and change the encoding of the file to UTF-8 without BOM.