Keyword

Make all existing AND new users K2 users automatically!

More
14 years 7 months ago #78887 by Trond
I have one important question that I think all community developers are wondering about.Do we have to manually move existing and new users to their user groups?If this is true we all have a huge administration problem!I am not only worried about Manually adding every new user because it is time consuming, but because putting users "on hold" might be enough to make them loose the interest.Content creation is a huge and sensitive field in every community - especially those who are selling ads or need SERP exposure. Content creation is essential for my growth and putting users on hold is a big mistake.I have several thousand registered users that I can move into the right user group, but manually finding and adding new users on a daily basis is to heavy for my time schedule.. Please tell me that there is possible to do all this automatically!! :-)I use Jomsocial and every new registration goes through jomsocial.

Oslo, Norway.

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #78888 by Pierre Balian
So from what I gather,
In k2 parameters you are supposed to be able to set the default k2 group...

I have the group "registered" selected, which is a user group that has submit content rights to all categories.

However after going through the entire registration process, and verifying by email - k2 has NOT assigned the user to that default group. I have to manually click on the username and hit save before he is added to the group.

Am I missing something here?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #78889 by natecovington
Same. Any help? I just looked through the JED (extensions.joomla.org) and didn't find any sort of plugin that might be able to do this in the background...

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #78890 by Adam D'arcy
Did anyone find the answer to this?

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #78891 by Luke Collymore
Replied by Luke Collymore on topic Make all existing AND new users K2 users automatically!
I've coded a solution, it's a hack of one jomSocial file, so use at your own risk and it may be removed when updating.

It will add the user to the default group as specified in k2 component parameters.

 

In the following file;

components/com_community/controllers/register.php

around line 490, just after $this->_sendEMail('registration_complete', $user , null , $multiprofile->approvals );

 

Add the following,

       //HACK to add user into k2_users table.        $db = JFactory::getDBO();        $filter = new JFilterInput(array(), array(), 1, 1, 0);        $k2Params = &JComponentHelper::getParams('com_k2');        $gender = strtolower(substr($values[2],0,1));        $bio = $db->Quote($filter->clean($values[4]));        $gid = $k2Params->get('K2UserGroup', 1);               $query= "insert into #__k2_users values('',".$user->id.",'".$user->username."','{$gender}',{$bio},'','',{$gid},'');";        $db->setQuery($query);        $db->query();

 

You may have to change $values[x] depending on if you've changed the jomSocial registration fields and orders.

 

Luke.

www.develodesign.co.uk

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #78892 by natecovington
If you look at the code for the K2 User plugin, there is an "if" statement that you can disable so that it also works with other component registrations... I remember reading about this somewhere that was discussing using AlphaRegistration but I'm guessing the same would apply for JomSocial, Community Builder, VirtueMart, etc...

Please Log in or Create an account to join the conversation.

  • Visual Impact Web Design
  • Visual Impact Web Design's Avatar
  • Offline
  • New Member
More
13 years 2 months ago #78893 by Visual Impact Web Design
Replied by Visual Impact Web Design on topic Make all existing AND new users K2 users automatically!
Luke, you have me so so so happy!

I have been looking for this solution for 9 months!!! and was about to employ a php developer just to deal with this issue!

 

Thank you so so much!!!

 

 

Luke Collymore said:

I've coded a solution, it's a hack of one jomSocial file, so use at your own risk and it may be removed when updating.

It will add the user to the default group as specified in k2 component parameters.

 

In the following file;

components/com_community/controllers/register.php

around line 490, just after $this->_sendEMail('registration_complete', $user , null , $multiprofile->approvals );

 

Add the following,

       //HACK to add user into k2_users table.        $db = JFactory::getDBO();        $filter = new JFilterInput(array(), array(), 1, 1, 0);        $k2Params = &JComponentHelper::getParams('com_k2');        $gender = strtolower(substr($values[2],0,1));        $bio = $db->Quote($filter->clean($values[4]));        $gid = $k2Params->get('K2UserGroup', 1);               $query= "insert into #__k2_users values('',".$user->id.",'".$user->username."','{$gender}',{$bio},'','',{$gid},'');";        $db->setQuery($query);        $db->query();

 

You may have to change $values[x] depending on if you've changed the jomSocial registration fields and orders.

 

Luke.

www.develodesign.co.uk

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum