Add action

How can i add a action that is only visible when you visit your own profile?
I have the module Actions Manager...

Quote · 7 Feb 2013

are you referring to adding an actions button in the actions block such as the greeting or befriend buttons

caredesign.net
Quote · 7 Feb 2013

step 1 - templates/base/scripts/BxBaseProfilesView.php - find (around line 435)

 

  if(isMember()) {
            $p_arr['cpt_edit'] = _t('_EditProfile');
            $p_arr['cpt_send_letter'] = _t('_SendLetter');
            $p_arr['cpt_fave'] = '';
            $p_arr['cpt_remove_fave'] = '';
            $p_arr['cpt_befriend'] = _t('_Befriend');
            $p_arr['cpt_remove_friend'] = _t('_Remove friend');
            $p_arr['cpt_get_mail'] = '';
            $p_arr['cpt_share'] = _t('_Share');
            $p_arr['cpt_report'] = _t('_Report Spam');
            $p_arr['cpt_block'] = '';
            $p_arr['cpt_unblock'] = '';
        } else {
            $p_arr['cpt_edit'] = '';
            $p_arr['cpt_send_letter'] = '';
            $p_arr['cpt_fave'] = '';
            $p_arr['cpt_remove_fave'] = '';
            $p_arr['cpt_befriend'] = '';
            $p_arr['cpt_remove_friend'] = '';
            $p_arr['cpt_get_mail'] = '';
            $p_arr['cpt_share'] = '';
            $p_arr['cpt_report'] = '';
            $p_arr['cpt_block'] = '';
            $p_arr['cpt_unblock'] = '';
        }

 

top section is what members see, bottom is what non members see

 

if you want to hide a btton, then add '' in place of the _t('_Whatever')

 

if you want to add a line then copy one of the already existing buttons and just change the name, again, remember top section and bottom section should be identical except for after the =.

 

Step 2 - Make sure to add a language key for each new button you create.

Step 3 - run this sql script in your phpmyadmin or deanos tool change the text in red to fit your needs:

INSERT INTO `yourtable`.`sys_objects_actions` (

`ID` ,
`Caption` ,
`Icon` ,
`Url` ,
`Script` ,
`Eval` ,
`Order` ,
`Type` ,
`bDisplayInSubMenuHeader`

)
VALUES (

NULL , '{evalResult}', 'paper-clip', 'page/whatever?id={ID}', '', 'if ({ID} != {member_id}) return; return _t(''{cpt_whatever}'');', '0', 'Profile', '0'

);


if that doesnt work - go into your sys_objects_actions table - i find it easy to just use phpmyadmin and copy the very first entry - which in my case is the edit button. then change the url field and the eval field. in the eval field, you only need to change the cpt_whatever

caredesign.net
Quote · 7 Feb 2013

Always remember to clear cache after making changes to the sys_objects_actions table (or any of the sys_ tables)

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 7 Feb 2013
 
 
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.