Use PHP instead of HTML in Promo Block?

Is it possible?

Quote · 29 May 2010

Pinging this up to the top, since I'd like to do this as well.  Anybody?

Quote · 2 Oct 2010

It may work the same way as PHP blocks, depending on where the promo's HTML block content is located (somewhere in the database).

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 3 Oct 2010

You can turn the custom html promo area into a php block with a few code changes.

inc/design.inc.php at about line 268

Change this.

if( getParam( 'enable_flash_promo' ) != 'on' )
$sCode = '<div class="promo_code_wrapper">' . getParam( 'custom_promo_code' ) . '</div>';
else {

To this.

if( getParam( 'enable_flash_promo' ) != 'on' )
//$sCode = '<div class="promo_code_wrapper">' . getParam( 'custom_promo_code' ) . '</div>';
{
$sContent = stripslashes(getParam('custom_promo_code'));
ob_start();
$aResult = eval($sContent);
$sContent = ob_get_clean();
$sCode = '<div class="promo_code_wrapper">' . $sContent . '</div>';
}

else {

Then in administration/basic_settings.php at about line 128

Change this.

$aFormText = array(
'form_attrs' => array(
'id' => 'adm-settings-form-promo-text',
'name' => 'adm-settings-form-promo-text',
'action' => $GLOBALS['site']['url_admin'] . 'basic_settings.php',
'method' => 'post',
'enctype' => 'multipart/form-data'
),
'params' => array(),
'inputs' => array(
'type' => array(
'type' => 'hidden',
'name' => 'type',
'value' => 'text',
),
'content_text' => array(
'type' => 'textarea',
'name' => 'content_text',
'caption' => '',
'value' => stripslashes(getParam('custom_promo_code')),
'colspan' => true,
'html' => 3,
'db' => array (
'pass' => 'XssHtml',
),
),
'save_text' => array(
'type' => 'submit',
'name' => 'save_text',
'value' => _t("_adm_btn_settings_save"),
)
)
);

To this.

$aFormText = array(
'form_attrs' => array(
'id' => 'adm-settings-form-promo-text',
'name' => 'adm-settings-form-promo-text',
'action' => $GLOBALS['site']['url_admin'] . 'basic_settings.php',
'method' => 'post',
'enctype' => 'multipart/form-data'
),
'params' => array(),
'inputs' => array(
'type' => array(
'type' => 'hidden',
'name' => 'type',
'value' => 'text',
),
'content_text' => array(
'type' => 'textarea',
'name' => 'content_text',
'caption' => '',
'value' => stripslashes(getParam('custom_promo_code')),
'colspan' => false,
'html' => 0,
//'db' => array (
//'pass' => 'XssHtml',
//),
),
'save_text' => array(
'type' => 'submit',
'name' => 'save_text',
'value' => _t("_adm_btn_settings_save"),
)
)
);


The text area block is a bit small. I have not found where to change that yet, but thats just a cosmetic thing.

https://www.deanbassett.com
Quote · 3 Oct 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.