template->_tpl_load_file(): File /credits_body.html does...

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
Quezza
Registered User
Posts: 212
Joined: Sat Oct 23, 2004 7:17 pm
Location: Hertfordshire, UK
Contact:

template->_tpl_load_file(): File /credits_body.html does...

Post by Quezza » Fri Jun 01, 2007 11:30 am

Hi Guys,

I'm trying to make a credits MOD, but for some reason I keep getting this error:
template->_tpl_load_file(): File /credits_body.html does not exist or is empty
I have a file named credits.php in the root and then a credits_body.html file in the styles/prosilver/templates directory.

Here is a cut down version of my credits.php file:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

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

// Now loop through the array for the credits
foreach ($creditsarray as $creditdetails){
    // Check if has got a web address
    if ($creditdetails['url'] != ''){
        $got_url = true;
    } else {
        $got_url = false;
    }
    
    // Send vars to the template
    $template->assign_block_vars('creditsrow', array(
        'TITLE' => $creditdetails['title'],
        'AUTHOR' => $creditdetails['author'],
        'URL' => $creditdetails['url']
    ));
}

// Output the page
page_header('Code Credits');


// Set the filename of the template
$template->set_filenames(array(
    'body' => 'credits_body.html')
);

page_footer();
?>
I have refreshed all templates, etc... I can't understand why it won't work. BTW I'm gonna add the language stuff later, at the moment I am just using hard coded text.

Any help would be greatly appreciated :D

gmvasek
Registered User
Posts: 7
Joined: Sun Nov 20, 2005 10:57 am
Location: Czech Republic
Contact:

Re: template->_tpl_load_file(): File /credits_body.html does...

Post by gmvasek » Sat Oct 20, 2007 3:57 pm

Yes, I had a same problem. You must set a language file on the beginning of file, otherwise it will not work. Just add this line to beginning of file and create a file blank.php in all your language folders with the content below.

Code: Select all

$user->setup('blank');
Contents of blank.php file:

Code: Select all

<?php
/** 
*
* blank [Czech]
*
* @package language
* @version $Id: groups.php,v 1.21 2007/05/10 15:31:21 acydburn Exp $
* @copyright (c) 2005 phpBB Group 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* DO NOT CHANGE
*/
if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

?>
PS: Sorry for my bad english...

Locked

Return to “[3.0.x] MOD Writers Discussion”