2012-11-09 2 views
0

누군가가이 문제를 도와 주길 바랍니다. CMSMS 내에서 smarty를 사용하고 있으며 내 페이지 내에서 실행되는 사용자 정의 태그라는 것이 있습니다. 여기에는 다음 코드가 포함되어 있습니다.알 수없는 메소드 '_compile_source'호출. 멋지군 3

$db = cmsms()->GetDb(); 
$menu = $smarty->get_template_vars('page'); 
$user_id = $smarty->get_template_vars('userid'); 
if (!isset($user_id)) { 
    $user_id = -1; 
} 

// Getting menu items from DB 
$query = 'SELECT * FROM '. cms_db_prefix() .'module_tools_options 
WHERE active = 1 AND user_id = ? AND menu = ? 
ORDER BY sort'; 
$dbresult = $db->Execute($query, array($user_id, $menu)); 

while ($dbresult && $row = $dbresult->FetchRow()) { 
$smarty->_compile_source('preprocess template', $row['title'], $_compiled); 
@ob_start(); 
$smarty->_eval('?>' . $_compiled); 
$result = @ob_get_contents(); 
@ob_end_clean(); 
    echo '<li id="menu_' . $row['option_id'] . '">' . $result . "</li>\n"; 
} 

CMSMS 설치가 업그레이드되어 smarty 3이 실행되어 내 페이지가 손상되었습니다.

/lib/smarty/sysplugins/smarty_internal_templatebase.php: Call of unknown method '_compile_source'.

내가 컴파일 소스 방법은 누군가가 교체 또는 다시 작동이 얻을 수있는 방법을 올바른 방향으로 날 지점 수 멋지 3에 감가 상각 된 것 같아요 : 나는 다음과 같은 오류가 발생합니다?

많은 감사

답변

0

교체 :

$smarty->_compile_source('preprocess template', $row['title'], $_compiled); 
@ob_start(); 
$smarty->_eval('?>' . $_compiled); 
$result = @ob_get_contents(); 
@ob_end_clean(); 

으로 :

$result = $smarty->fetch('string:'.$row['title']); 
관련 문제