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