2011-08-04 7 views
0

스레드를 추가하고 phpBB에 메시지를 표시하고 싶습니다. '난에, =>'message_body.html ''몸 '을 변경하는 경우phpBB 템플릿 API 오류

template->_tpl_load_file(): File message_body.html does not exist or is empty

: 다음은 내 코드입니다 :

<?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); 
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); 
include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 
include($phpbb_root_path . 'includes/message_parser.' . $phpEx); 

$user->session_begin(); 
$auth->acl($user->data); 


// New Topic Example 
$subject = 'TEST: Test topic'; 
$message = 'This is test message'; 

$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage 
$allow_bbcode = $allow_urls = $allow_smilies = true; 
generate_text_for_storage($text, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies); 

$data = array( 
    // General Posting Settings 
    'forum_id'   => 2, // The forum ID in which the post will be placed. (int) 
    'topic_id'   => 0, // Post a new topic or in an existing one? Set to 0 to create a new one, if not, specify your topic ID here instead. 
    'icon_id'   => false, // The Icon ID in which the post will be displayed with on the viewforum, set to false for icon_id. (int) 

    // Defining Post Options 
    'enable_bbcode' => true, // Enable BBcode in this post. (bool) 
    'enable_smilies' => true, // Enabe smilies in this post. (bool) 
    'enable_urls'  => true, // Enable self-parsing URL links in this post. (bool) 
    'enable_sig'  => true, // Enable the signature of the poster to be displayed in the post. (bool) 

    // Message Body 
    'message'   => $message,  // Your text you wish to have submitted. It should pass through generate_text_for_storage() before this. (string) 
    'message_md5' => md5($message),// The md5 hash of your message 

    // Values from generate_text_for_storage() 
    'bbcode_bitfield' => $bitfield, // Value created from the generate_text_for_storage() function. 
    'bbcode_uid'  => $uid,  // Value created from the generate_text_for_storage() function. 

    // Other Options 
    'post_edit_locked' => 0,  // Disallow post editing? 1 = Yes, 0 = No 
    'topic_title'  => $subject, // Subject/Title of the topic. (string) 

    // Email Notification Settings 
    'notify_set'  => false,  // (bool) 
    'notify'   => false,  // (bool) 
    'post_time'   => 0,  // Set a specific time, use 0 to let submit_post() take care of getting the proper time (int) 
    'forum_name'  => '',  // For identifying the name of the forum in a notification email. (string) 

    // Indexing 
    'enable_indexing' => true,  // Allow indexing the post? (bool) 

    // 3.0.6 
    'force_approved_state' => true, // Allow the post to be submitted without going into unapproved queue 
); 
$array = array(); 
$link = submit_post('post', $subject, '', POST_NORMAL, $array, $data); 
//echo $link; 

$template->assign_vars(array(
    'MESSAGE_TITLE' => 'Okay', 
    'MESSAGE_TEXT' => 'Message added! <br /><br /><a href='.$link.'>Go to thread</a>', 
    ) 
); 

page_header(); 
$template->set_filenames(array(
     'body' => 'message_body.html', 
)); 
page_footer(); 

스레드 생성되지만 메시지가 오류로 보여 어쩌려 구`t 변경 어쩌려 구`t 몸 '=>'스타일/prosilver/템플릿/message_body.html '오류 :

template->_tpl_load_file(): File /styles/prosilver/template/message_body.html does not exist or is empty

오류가 무엇입니까? 미리 감사드립니다.

P.S : 나는 러시아 출신이므로 나쁜 영어로 유감입니다.

답변

0

API에 오류가 없습니다 - message_body.html 템플릿 파일이 없습니다. 현재 스타일 설정에 따라,이 오류를 해결하려면 현재 스타일의 템플리트 폴더에 message_body.html이 아닌 비어 있지 않은 HTML 파일을 작성해야합니다.