• rightrock

    (@rightrock)


    Hi all,

    I’m using s2Member and added the plugin Profiler in order to create a member directory.

    Because the member levels in s2Member are s2Member Level 1, s2Member Level 2 etc I changed the code in the profiler.php file from:

    function pf_get_enabledroles()
    {
    $administrator = get_option(‘pf_show_roles_admin’);
    $subscriber = get_option(‘pf_show_roles_subscriber’);
    $author = get_option(‘pf_show_roles_author’);
    $editor = get_option(‘pf_show_roles_editor’);
    $contributor = get_option(‘pf_show_roles_contributor’);
    $none = get_option(‘pf_show_roles_none’);

    to:
    function pf_get_enabledroles()
    {
    $administrator = get_option(‘pf_show_roles_admin’);
    $s2Member Level 2 = get_option(‘pf_show_roles_s2Member_Level_2’);
    $author = get_option(‘pf_show_roles_author’);
    $editor = get_option(‘pf_show_roles_editor’);
    $contributor = get_option(‘pf_show_roles_contributor’);
    $none = get_option(‘pf_show_roles_none’);

    Basically changing subscriber to s2Member Level 2 so I could choose that as a member option to list in the directory.

    When I did that I got the following error:
    Parse error: syntax error, unexpected T_STRING in /home/mongoose/public_html/main/wp-content/plugins/profiler/profiler.php on line 89

    I checked that line and it looks to be this one:
    $s2Member Level 2 = get_option(‘pf_show_roles_s2Member_Level_2’);

    which looks correct to me but I’m not a php guru.

    Anyone have any suggestions? Even if it’s another plug in that would work.

    Thanks,

    Joe

Viewing 1 replies (of 1 total)
  • esmi

    (@esmi)

    $s2Member Level 2c not only won’t be a variable within the rest of the plugin code, it’s not even a proper PHP variable. Variable names don’t have spaces in theme – which is what is triggering the initial error.

    However, even if you fix that error and change every instance of $subscriber to something like $s2Member_Level_2c, $subscriber = get_option('pf_show_roles_subscriber'); is pulling a previously stored, specific, value from the wp-options table of your database. You can’t just tack some extra characters onto pf_show_roles_subscriber as the amended option won’t exist in the table.

Viewing 1 replies (of 1 total)

The topic ‘Error editing Profiler plugin’ is closed to new replies.