Craigr
Active member
Using this tutorial i have made a page where i query a few things from the database. I have previous entry that was entered using BB Code and shows fine in the database, but when it is displayed on the new page that i have created there are no line breaks, etc. Just wondering how to make it show that the BB Code works. I have attached my PHP file below with the query. The one i am trying to parse is $query_results['intro_text']. Any help would be appreciated. 
 
Roh.php
	
	
	
		
 
Template:
	
	
	
		
				
			Roh.php
		Code:
	
	<?php
class ExternalPages_ControllerPublic_Roh extends XenForo_ControllerPublic_Abstract
{
    public function actionIndex()
    {
        $visitor = XenForo_Visitor::getInstance();
        $sessionModel = $this->getModelFromCache('XenForo_Model_Session');
        $onlineUsers = $sessionModel->getSessionActivityQuickList(
            $visitor->toArray(),
            array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
            ($visitor['user_id'] ? $visitor->toArray() : null)
        );
        $boardTotals = $this->getModelFromCache('XenForo_Model_DataRegistry')->get('boardTotals');
        if (!$boardTotals)
            $boardTotals = $this->getModelFromCache('XenForo_Model_Counters')->rebuildBoardTotalsCounter();
        
        $db = XenForo_Application::get('db');
        $query_results = $db->fetchRow("SELECT intro_text,stats_numimages,stats_numviews FROM `bb1_gallery_settings` WHERE settingid = 1");
        $viewParams = array(
            'onlineUsers' => $onlineUsers,
            'boardTotals' => $boardTotals,
            'aboutthesite' => $query_results['intro_text'],
            'stats_numimages' => $query_results['stats_numimages'],
            'stats_numviews' => $query_results['stats_numviews']
        );
        
        return $this->responseView('ExternalPages_ViewPublic_Advertise', 'ROH_index', $viewParams);
    }
}
	Template:
		Code:
	
	<xen:h1>Special Forces Roll Of Honour</xen:h1>
<xen:title>Special Forces Roll Of Honour</xen:title>
<xen:description>A memorial to Special Forces past,present and future.</xen:description>
<xen:navigation>
    <xen:breadcrumb href="{xen:link full:en/roh/}">Roll Of Honour</xen:breadcrumb>
</xen:navigation>
About The Site:<br />
{$aboutthesite}
<hr />
Images: {$stats_numimages}<br />
Views: {$stats_numviews}
<xen:sidebar>
    <xen:include template="sidebar_online_users" />
    <xen:include template="forum_stats" />
    <xen:include template="sidebar_share_page" />
</xen:sidebar>