newdreamers
Thanks JTADEO. Now, ok, I just couldn't resist digging more into it, so if you want to enable PHP BLOCKS in the admin section, simply follow the 4-steps guide below.

Note: I strongly recommend you backup your BxDolPageViewAdmin.php just in case...

--------------------
STEP 1
--------------------
Run the following Insert query in the pageCompose table:

INSERT INTO `PageCompose` ( `ID` , `Page` , `PageWidth` , `Desc` , `Caption` , `Column` , `Order` , `Func` , `Content` , `DesignBox` , see more `ColWidth` , `Visible` , `MinWidth` )
VALUES (NULL , '', '960px', 'PHP Block', '_PHP Block', '0', '0', 'Sample', 'PHP', '1', '0', 'non,memb', '0');

The key field is "Func", being set to "Sample". Any record set to "Sample" in this table will make the relevant block appear among the Samples(!) in the "page builders" section. Try and look at any page from the Page Builders screen, you'll now see the PHP block displayed as Sample.

--------------------
STEP 2
--------------------

Edit the following file:
./inc/classes/BxDolPageViewAdmin.php

Update the saveItem function (starting line 174) by modifying line 187:

FROM: elseif( $sFunc == 'Echo' )
TO: elseif( $sFunc == 'Echo' or $sFunc == 'PHP' )

This will enable the PHP code to be saved from the admin interface.

--------------------
STEP 3
--------------------

Modify line 553:

FROM: if( $aItem['Func'] == 'RSS' or $aItem['Func'] == 'Echo' ) {
TO: if( $aItem['Func'] == 'RSS' or $aItem['Func'] == 'Echo' or $aItem['Func'] == 'PHP' ) {

This will enable the "Delete" button in the PHP blocks popup form

--------------------
STEP 4
--------------------

Search for :

if( $aItem['Func'] == 'Echo' )

This IF condition defines what fields to display in the block popup form, based on the block type/func. You just need to insert the following on line 533
(just before the end of the IF condition for the HTML blocks):

... etc etc...
<?
// THE INSERT STARTS HERE

} elseif( $aItem['Func'] == 'PHP' ) {
?>
<tr>
<td class="form_label">PHP-code:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="form_colspan" colspan="2">
<textarea style="width: 450px; height: 350px;" name="Content"><?= htmlspecialchars_adv( $aItem['Content'] ) ?></textarea>
</td>
</tr>
<?

// THE INSERT FINISHES HERE
} elseif( $aItem['Func'] == 'RSS' ) {
... etc etc...

--------------------
ET VOILA!
--------------------

Now you can manage PHP blocks straight from the admin section without having to fiddle with MySQL or other geeky stuff!

Personally I can think of loads of new blocks I'm gonna create... right now actually!

Dunno what's coming up with 6.2, hope fully they'll incorporate this by default :-)

HAVE FUN!

--------------------
DISCLAIMER
--------------------
- Don't make the modif if you're not comfortable with PHP
- This "hack" might get overridden/overwritten by future releases
 
 
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.
PET:0.036475896835327