Ray

About me: Web Designer and Entrepreneur
Location:
Email: Ray@steelnerve.com

Send private message

You must be logged in to send a private message.

Group membership

Activity

  • Ray joined the group General Discussion
  • Ray replied on the discussion topic Group Access Modification
    ok i'll try it and see how it goes!...now i just have to figure out how to prevent them from seeing the other groups...that's still on the table but this helps a lot!!! BTW, where's your galaxy?   Thanks!1 view reply
  • Ray replied on the discussion topic Group Access Modification
    What about simply removing the options and making the group option default on the privacy settings when you post? that way all content would only be in the group that person was a member of...this is obviously provided that they're assigned to... view reply
  • Ray replied on the discussion topic Simple Group Assign After Registration
    WOW...i just wrote a HUGE paragraph and forgot to click submit...walked away, came back an hour later, clicked submit and the error box pops up sayin the page expired and then it wouldn't let me get my comment back...UGH!   anyways, so the... view reply
  • Ray joined the group General Discussion
  • Ray added a new discussion topic Group Access Modification in the group Plugin Development
    Hey all!! I'm trying to setup a site www.ihaveyouhave.com and aside from my other post the last feature I need to implement is to remove the Access drop down menu you get when creating content and instead just assign the content to the group the...
    • What about simply removing the options and making the group option default on the privacy settings when you post? that way all content would only be in the group that person was a member of...this is obviously provided that they're assigned to groups and can't ad other groups but I think i can get rid of that kind of stuff by commenting out the actual code, right?

       

      Thanks!!

      -Ray-

    • (1)

      yep... if you've looked at the actual code in the views --> that will work ;-)

      (2)

      ever thot abt posting in my galaxy ? LOLZ ;-O

    • ok i'll try it and see how it goes!...now i just have to figure out how to prevent them from seeing the other groups...that's still on the table but this helps a lot!!! BTW, where's your galaxy?

       

      Thanks!1

  • Ray added a new discussion topic Simple Group Assign After Registration in the group Plugin Development
    Hey all! I'm kind of hoping someone might be interested in helping me out with this or atleast offering some ideas because even shooting the breeze is helpful here. I want to have users assigned to a group upon registration. The easy part is that...
    • Hi Ray,

      Here are some thoughts if you let the user select his school during registration:

      • The registration form is implemented by the "account/forms/register" view.  You would add your new UI elements to views/default/account/forms/register.php.
      • You need some way to carry the group selected through the registration process.
      • Note that a new user is disabled until validated; I assume that you are using the uservalidationbyemail plugin.
      • It may be confusing to the user that there's an validation e-mail and then an invite to join a group that he has already selected during registration.
      • You would need to disable the various group management actions (e.g. add to group).

      I think you may have a smoother process if you let the user select his school during validation instead.  Here's what I would try:

      • Let the group for a new user be specified by say the "school_group" parameter.
      • Register a plugin hook for the "email/confirm" action.  If "school_group" is missing, redirect the user to a page where he can select his school.  The email confirmation request is then resubmitted with school_group.  (We can talk about how to do a plugin hook for action if you are not familiar with it.)
      • If school_group is present, than upon successful validation, the plugin hook would cause the new user to be added to the group (basically a ElggGroup::join() call).

      -- Patrick

    • WOW...i just wrote a HUGE paragraph and forgot to click submit...walked away, came back an hour later, clicked submit and the error box pops up sayin the page expired and then it wouldn't let me get my comment back...UGH!

       

      anyways, so the gist is this...on the site now i have a field in registration where they can chose their school from a drop down menu but it's only a tag field...can i harness that power somehow and maybe do something like:

       

      after email confirmation

      get infofield_school

      find the group with the same name(i'd manually create the schools(i.e. groups) in the database that I want)

      Autoinvite/autoaccept

       

       

      What cha think?

       

      Thanks!

      -Ray-

       

    • The "email/confirm" action triggers an 'enable' event when the confirmation is verified, so it is simpler than I thought.  I don't know how you pass 'infofield_school' around, but something like the following would work:

      function blah_email_confirm_hook() {
        register_elgg_event_handler('enable', 'user', 'blah_user_enabled');
        return true;
      }

      function blah_user_enabled($event, $type, $user) {
        // just some sanity checks
        //
        if ($event != 'enable' || $type != 'user' || !($user instanceof ElggUser))
          return true;

        // TODO: where does school group GUID come from?  Is it a
        // parameter encoded in the e-mail confirmation URL?
        //
        $grp_guid = get_input('infofield_school');
        $usr_guid = $user->guid;

        // add user to group
        // TODO: make sure $grp_guid is a valid school group
        //
        if (!is_group_member($grp_guid, $usr_guid)) {
          if (!join_group($grp_guid, $usr_guid)) {
            // TODO: error handling
          }
        }

        return true;
      }

      // register hook for email/confirm, e.g. in a plugin's start.php
      //
      register_plugin_hook('action', 'email/confirm', 'blah_email_confirm_hook');