Profile Fields Builder Duplicate System Block

Hi everyone

I am wanting to duplicate a block onto the View Profile (using the fileds builder).  The block I wish to copy is Membership, this block shows the membership level, it is currently only available on the Fields Builder Edit Profile Admin View.  I want to be able to have the same block viewable on Fields Builder View Profile Member and Visitor Views. I want this so I can show what the members membership level is to themselves and also visitors to view also.  Anyone had experience in doing this?

Thanks in advance to all who help out.

clubbeyourself
Quote · 28 Sep 2010
Actually would like to say that this might be a nice feature for the next version of Deanos Tools Mod. The ability to copy a system block to another part (page) of the fields builder. What say you all? What do you think Deano?
clubbeyourself
Quote · 28 Sep 2010

You can't use this code because it's coded only for admin and have more features than only view the member's level,
but you can try my code below, will add a new box on profile page with members status,
(like what you have here /modules/?r=membership/index/)

1)
open file modules/boonex/membership/classes/BxMbpModule.php

find this code

class BxMbpModule extends BxDolModule {
/**
* Constructor
*/
function BxMbpModule($aModule) {
parent::BxDolModule($aModule);

$this->_oConfig->init($this->_oDb);
}

add code below after this code


function serviceGetMemberLevel($iProfileId) {
$aUserLevel = getMemberMembershipInfo($iProfileId);        
return $this->_oTemplate->displayCurrentLevel($aUserLevel);
}


2)
use phpMyAdmin and run this sql on your DB (or sys_page_compose)

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES
('profile', '998px', 'My Level', '_membership_bcaption_my_status', 0, 0, 'PHP', 'bx_import(''BxDolService''); return BxDolService::call(''membership'', ''get_member_level'', array($this->oProfileGen->_iProfileID));', 1, 34, 'non,memb', 0);


3)
go to admin/Builders/Pages Blocks -> Select Profile page

Move item My Status from Inactive Blocks to Active Blocks

 

4) DONE!

Now you can take a look at the profile page

Quote · 28 Sep 2010

 

Actually would like to say that this might be a nice feature for the next version of Deanos Tools Mod. The ability to copy a system block to another part (page) of the fields builder. What say you all? What do you think Deano?

I have a seperate mod for copying blocks. But most system blocks cannot be copied. In fact, none can. Special blocks are specifically written for the page they are on.

In most cases only blocks of type PHP, HTML and RSS can be copied. All others cannot. Thats why php blocks are so handy. In a lot of cases you have to write your own.




https://www.deanbassett.com
Quote · 28 Sep 2010

Thanks Deano for the information.

 

Actually would like to say that this might be a nice feature for the next version of Deanos Tools Mod. The ability to copy a system block to another part (page) of the fields builder. What say you all? What do you think Deano?

I have a seperate mod for copying blocks. But most system blocks cannot be copied. In fact, none can. Special blocks are specifically written for the page they are on.

In most cases only blocks of type PHP, HTML and RSS can be copied. All others cannot. Thats why php blocks are so handy. In a lot of cases you have to write your own.




 

clubbeyourself
Quote · 29 Sep 2010

Thanks I will give that a try.

You can't use this code because it's coded only for admin and have more features than only view the member's level,
but you can try my code below, will add a new box on profile page with members status,
(like what you have here /modules/?r=membership/index/)

1)
open file modules/boonex/membership/classes/BxMbpModule.php

find this code

class BxMbpModule extends BxDolModule {
/**
* Constructor
*/
function BxMbpModule($aModule) {
parent::BxDolModule($aModule);

$this->_oConfig->init($this->_oDb);
}

add code below after this code


function serviceGetMemberLevel($iProfileId) {
$aUserLevel = getMemberMembershipInfo($iProfileId);        
return $this->_oTemplate->displayCurrentLevel($aUserLevel);
}


2)
use phpMyAdmin and run this sql on your DB (or sys_page_compose)

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES
('profile', '998px', 'My Level', '_membership_bcaption_my_status', 0, 0, 'PHP', 'bx_import(''BxDolService''); return BxDolService::call(''membership'', ''get_member_level'', array($this->oProfileGen->_iProfileID));', 1, 34, 'non,memb', 0);


3)
go to admin/Builders/Pages Blocks -> Select Profile page

Move item My Status from Inactive Blocks to Active Blocks

 

4) DONE!

Now you can take a look at the profile page

 

clubbeyourself
Quote · 29 Sep 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.