how do you add new block to contacts page?

I need to create a custom block above the default forms on Contacts page. I've tried to add php function in contacts.php. Below is a sample cod from contacts.php. I've highlighted what I've added in bold. However, it does not return anything in front end. The content for _CONTACT_TEXT is in the Language settings.

Where am I going wrong? How do I create custom php code to display new block on contacts page?

// --------------- page components

$showForm = getParam('enable_contact_form') == 'on' ? true : false ;

$_ni = $_page['name_index'];

if( $showForm ) {

$_page_cont[$_ni]['page_main_code'] = PageCompMainCode();
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCodeWithForm();

}


else {
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
}

// --------------- [END] page components


PageCode();

// --------------- page components functions

/**
* page code function
*/
function PageCompPageMainCode() {
global $oTemplConfig;
return DesignBoxContent( _t('_CONTACT_H1'),  MsgBox(_t('_CONTACT')), $oTemplConfig->PageCompThird_db_num);
}

function PageCompMainCode() {
global $oTemplConfig;
$ret = _t( "_CONTACT_TEXT");
return DesignBoxContent( _t("_CONTACT_H"), $ret, $oTemplConfig -> PageCompThird_db_num );
}




function PageCompPageMainCodeWithForm() {
global $oTemplConfig, $site;

etc. .....

Quote · 27 Feb 2010

Hello

Try to use the following code


if( $showForm ) {
$_page_cont[$_ni]['page_main_code'] = PageCompMainCode();
$_page_cont[$_ni]['page_main_code'] .= PageCompPageMainCodeWithForm();
}

instead of


if( $showForm ) {
$_page_cont[$_ni]['page_main_code'] = PageCompMainCode();
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCodeWithForm();
}

---
Best Regards
Anton Lesnikov
AQB Soft

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 27 Feb 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.