Actions Block Variables

Where would I find the variables for the actions block?

In the sys_objects_actions, for the mail button, there is this:

if ({ID} == {member_id}) return;
return _t('{cpt_send_letter}');

where would the {member_id} variable be defined?

I have added a new button to Suspend a Profile, but I only want it available to a specific user type (I added a field in the Profiles table called UserType).

This is what I have for my new block that I created (Called Suspend) under the Eval Field:

if ({ID} == {member_id}) return;

$UserType  = {UserType};

if ( $UserType == 'Lead Staff' ) {
    return _t('{cpt_suspend}');
}

So, I am trying to get this to work.

Thanks in advance.

caredesign.net
Quote · 19 Sep 2013

OK, I had a brain fart there. I managed to get it working, somewhat. Here is what I have:

in my database - sys_objects_actions - in the Eval field, I have:

if ({ID} == {member_id}) return;

$UserTy  = '{user_type}';

if ( $UserTy = 'Lead Staff' ) {
    return _t('{cpt_suspend}');
}

In the Caption field, I have:

{evalResult}

URL field is blank, and in the Script field, I have:

showPopupAnyHtml('confirm.php?member={ID}')

in profiles.inc.php I have:

function getUserType( $ID = '' )
{
    if ( !(int)$ID )
        return '';

    $arr = getProfileInfo( $ID );
    return $arr['UserType'];
}

in BxBaseProfileView.php I have:

        $p_arr['user_type']        = getUserType( $iMemberID );

So far, the functionality is working. The button only appears if the logged in member is a Lead Staff member. Clicking the button opens a popup in which the Lead Staff member would confirm suspending the member. After clicking Yes, the members UserType is changed to blank, and the password is deleted from the database. All that works perfectly. But, my button is not displaying the correct text. Instead of displaying Suspend in the button it is showing {cpt_suspend} - see pic. I even created a language key and still not showing properly.

suspend button.png · 556.1K · 172 views
caredesign.net
Quote · 19 Sep 2013

OK, I managed to get it figured out:

if ({ID} == {member_id}) return;

$UserTy  = '{user_type}';

if ( $UserTy == 'Lead Staff' )
    return _t('{cpt_suspend}');

caredesign.net
Quote · 19 Sep 2013

I must be having a brain fart as well because I don't see what your issue was; show me the code differences please.

Geeks, making the world a better place
Quote · 19 Sep 2013

OLD:

if ({ID} == {member_id}) return;

$UserTy  = '{user_type}';

if ( $UserTy = 'Lead Staff' ) {
    return _t('{cpt_suspend}');
}

NEW:

if ({ID} == {member_id}) return;

$UserTy  = '{user_type}';

if ( $UserTy == 'Lead Staff' )
    return _t('{cpt_suspend}');

removed whats in red ( { } )- added whats in blue (=)

caredesign.net
Quote · 19 Sep 2013

I see it.  I think it was because I kept having to scroll back and forth.

Geeks, making the world a better place
Quote · 19 Sep 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.