phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Adding a custom page - changing included template :(

Want to chit chat about anything, do it here ... posting here won't increase your post count (or shouldn't!). Please do not post any "phpBB" specific topics here unless they do not fit into the category above. Do not post bug reports, feature or support requests!
Forum rules
Please do not post any "phpBB" specific topics here unless they do not fit into the category above.

Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests! Doing so will make Bertie a very sad bear indeed. :(

Adding a custom page - changing included template :(

Postby Iver » Wed May 20, 2009 12:16 pm

Hi all

Pretty new to phpBB so bare with me on this if it's too newbie:

I've added a custom page called custom_members.php as follows:

Code: Select all
<?php
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);

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

if ($user->data['user_id'] == ANONYMOUS)
{
   login_box('', $user->lang['LOGIN']);
}

if ($user->data['is_bot'])
{
   redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}

page_header('Telefon- og mailliste');

$template->set_filenames(array(   
   'body' => 'custom_members.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>


Straight of the wiki - no problem. Then I added my template called custom_members.html as follows:

Code: Select all
<!-- INCLUDE overall_header.html -->

<h2>Telefon- og mailliste14</h2>

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

   <div class="content">
      <p>
         <?php
         echo "test";
         $iver = "Iver er konge";
         echo $iver;
         ?>
      </p>
   </div>

   <span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->


The problem is that the following code gets stripped somewhere:

Code: Select all
<?php
echo "test";
$iver = "Iver er konge";
echo $iver;
?>


I can't figure out what to do?

I've tried changing the entire custom_members.html into a .php which outputs the same html.

My last option is to have the custom_members.php to trigger a php script that (over)writes the entire custom_members.html every time... I don't like that solution very much. Please help.

Best regards
Iver

Actually I would rather wri
Iver
Registered User
 
Posts: 0
Joined: Wed May 20, 2009 11:48 am

Re: Adding a custom page - changing included template :(

Postby Tom » Fri May 22, 2009 5:57 am

Sorry, but as the Chit Chat forum description suggests:

Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests!

Any support you need or questions you have such as this should be posted at phpBB.com. Thank you.
Tom Catullo - Moderator Team Member
phpBB.com | Area51 Rules & Regulations | My Projects
User avatar
Tom
Moderator Team
Moderator Team
 
Posts: 8
Joined: Sun Feb 11, 2007 3:26 pm
Location: Pennsylvania, USA


Return to Chit Chat

Who is online

Users browsing this forum: Bing [Bot] and 10 guests