• Resolved mat429

    (@mat429)


    Hi,
    i have been using the following code on my site to determine if the author page that is being viewed belongs to someone who is a member of the “instructors” group.

    The instructors group on my site has an id of 2

    This has been working fine until some time in the past week.

    <?php
    // active instructor?
    $sql .= "SELECT group_id FROM wp_groups_user_group AS ugrp WHERE ugrp.user_id = %d";
    $sql = $wpdb->prepare($sql, $curauth->ID);
    $groups = $wpdb->get_results($sql);
    $instructor = false;
    foreach ($groups as $group) {
      if ($group->group_id == 2) $instructor = true;
    }
    ?>

    I cant seem to figure out what has changed that would make it not work. has anyone got any ideas.

    An example of the page is here but this page should show information rather than the “not a current instructor” text

    any help much appreciated.

    Mat

    https://www.ads-software.com/plugins/groups/

Viewing 1 replies (of 1 total)
  • Thread Starter mat429

    (@mat429)

    Sorted, this was an incompatibility with the web shop plugin Zingiri and fixed itself once Zingiri was de-activated

    i guess becuase Zingiri uses “groups” of products, the two uses of “groups” interfered with each other, but i’m not techincal enough to be able to test this hypothesis.

Viewing 1 replies (of 1 total)
  • The topic ‘Can't recognise members of a group’ is closed to new replies.