The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Sorting member to group upon registration

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

In progress Sorting member to group upon registration

Post by Kami-sama on January 3rd 2017, 5:49 pm

Technical Details


Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link : ( link is hidden, you must reply to see )

Description of problem

Soo hey!

Is it possible to sort a person upon registration to a specific member group? A person would complete a test and based on the results he would be added to a specific group. If that is not possible, then maybe activating a certain profile field would?

I imagine, that this could be done with an HTML page?
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by SLGray on January 3rd 2017, 10:02 pm

Groups are only automatic by the number of posts.



When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40855
Reputation : 2773
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by APE on January 3rd 2017, 10:41 pm

No sorry you can only do it by post count or set it to non poster then 1 post then say 5 posts. There is no other way to do it.



avatar
APE
Manager
Manager

Male Posts : 10991
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 4th 2017, 9:12 am

Yea, I had a feeling it is not possible.

What about profile field? Would that be possible? based on test results profile field would be assigned a specific value.
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by APE on January 4th 2017, 7:23 pm

No sorry it can only be done by hand.



avatar
APE
Manager
Manager

Male Posts : 10991
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 4th 2017, 9:14 pm

What about, if users name would be included in a widget or page info after the results?
Example:

1) on HTML page or widget or portal user does a test
2) Test result is A
3) Somewhere appears text - username A
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by APE on January 4th 2017, 11:13 pm

not really sure it can be done but maybe @luffy can say if it can or not.

but i think its something we can't do but i could be wrong thou.



avatar
APE
Manager
Manager

Male Posts : 10991
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 4th 2017, 11:24 pm

Well programming can do a lot Very Happy
Question how to integrate that in HTML
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by APE on January 4th 2017, 11:29 pm

I'm really not sure sorry



avatar
APE
Manager
Manager

Male Posts : 10991
Reputation : 1031
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 11:14 am

Hello @Kami-sama,

I did not understand what exactly you want to do.. Could you please explain to me a little bit more?
Thanks and Happy New Year!





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 12:13 pm

Hey Luffy! so tis is what I imagine:

- user registers
- (if possible) during registration user completes a test
- test result is A
- somewhere text appears: username A

somewhere - either on that users profile or on a separate widget, html page.
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 1:11 pm

Okay so i have 2 questions:
  1. What kind of test is this? I mean do you have the code for the test upon registration or do you need a code for it?
  2. This A that will be the result, do you want it to appear next to the username as A for example or to be included in the name?





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 1:20 pm

1. No, I do not ave the test. I would need a code for that as well.
2. A is a group the member would belong to. So as we cannot add member automatically to groups, then the username should just appear next to A.
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 2:51 pm

So what will the test be?





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 3:32 pm

Well it depends how complicated it can be and how the answers will be calcucalted.

For example:

Will every answer have points. And results would be in ranges like from 0-5 result a, from 6-10 result b and so on.

OR:

Answers will add a point directly to the result. And in the end prevails the result that has the most points.

Anyways, for the sence of testing we can do something like this:

1. First question?
1) B result
2) A result
3) C result
4) D result

2. Second question?
1) a result
2) d result
3) b result
4) c result
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 8:02 pm

@Kami-sama so i managed to create a script that adds that letter to the username but do you want this to be visible all the times?
I mean i am a new user, and i register and i'm in group A. You want my username to show up Luffy and next to it the letter A forever?

I believe it's more simple if you simply do the ranking with profiles that way they'll show up automatically. Do you agree with this? Or do you want the A to be there forever?





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 8:54 pm

I think you maybe misunderstood me Wink

The goal of this test is to sort a member to a group.
As I understood, there is no way to have members sorted automatically.
There I and other Mods need a list of results. Example:
username1 - A
username2 - D

So as I see there could be 3 ways about this:
1) user sorted to group automatically (not possible)
2) user profile field value set with the test result
3) list of results as in example above
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 9:02 pm

Yes but sorting members can only be via these options:





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 9:03 pm

By "sorting" I mean assigning to a group ;D
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 9:13 pm

Okay so you'll be creating 4 groups in which you will add members in there?





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 9:15 pm

Exactly!
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 9:16 pm

Okay this script i made can create a rank (automatically) to those names with their group if you want! Wink

Anyway, this script is ready if you want, only thing i need to know now is the test because we have to adjust it to the forum! Wink





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 9:20 pm

By rank you mean something like we have here - "Forummember", "Manager"?
And one more thing, will it create a new rank every time or use already created ones?
And how the script can be implemented? HTML page? Portal? Widget?

P.S. Thank you for all your hard work Smile
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 9:28 pm

Okay so here's how this script works:

You create 3 new profile fields.
1. Question1 that has 4 possible answers
2. Question2 that has 4 possible answers
3. Result that grabs both question answers and give you a group result.

Let me explain some more. So we have 2 questions. Each answer has some certain points:
Question 1:
- Answer 1 (2 pts)
- Answer 2 (3 pts)
- Answer 3 (4 pts)
- Answer 4 (5 pts)
Question 2:
- Answer 1 (2 pts)
- Answer 2 (3 pts)
- Answer 3 (4 pts)
- Answer 4 (5 pts)

Now you have a new field named Result which grabs the answers and based on their points it adds the group as their group. For example:
4-5 pts -> Group A
6-7 pts -> Group B
8-9 pts -> Group C
10 pts -> Group D

All you need to do is add the javascript, make the fields and add some CSS.





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 9:31 pm

Oh this is great Smile

After the test is completed the question fields will be still visible or no?
I can test te script right now Wink

P.S. Many of my templates are adjusted so hopefully it will not be an issue.
P.P.S. Would this test be available only upon registration or for anyone who hasn't completed it yet? If it's the last option, is it possible to apply rank change only if a member has a specific rank? I think a simple if would do that.
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 9:52 pm

These adjustments can be always changed by you. You can tell whether members will be able to see this field or not when you create the fields.
So i will post a tutorial below in a few moments because i need to explain in detail what each thing is okay?





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 9:56 pm

Sure Wink Thank you lots!!
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 10:19 pm

Fields Creation:


Field 1:
Type: A list
Name: Question 1 (or whatever you want)
Description: Anything you want
URL icon: if you want you can add one
Necessarily filled? Yes
Display: Choose where you want them to show (i recommend only Profiles)
Display Type: Text
Who can modify the profile field value? Moderators (so members can't edit this) This way you can ask members these questions and you can edit these fields on their profiles or do it as you wish.
Display this field for users that are at least: Members
Separator: Back to the line

Now as list you can add the 4 potential answers. Let's say those answers are:
- Answer 1
- Answer 2
- Answer 3
- Answer 4




Now you have to create a second field with the exact same information.




For the third field you create it like this:
Type: Text Zone
Name: Test Result (or whatever you want)
Description: Anything you want
URL icon: if you want you can add one
Necessarily filled? No
Display: Choose where you want them to show (i recommend only Profiles)
Display Type: Text
Who can modify the profile field value? None because this field will not be touched.
Display this field for users that are at least: Members
Separator: Back to the line

and to the Text Zone as the default text you have to add this:
Code:
[table id="resultTest"][tr][td][/td][/tr][/table]


Javascript:

Now once you add the below javascript you need to make sure you add the correct profile field ids. Here's the javascript code:
Name: Anything
Placement: In all the pages
Code:
Code:
//Code by Luffy
$(document).ready(function(){   
  var a=$('dl#field_id1 .field_uneditable'), // id1
      b=$('dl#field_id2 .field_uneditable'); // id2
 
 //Question 1 Answers
  $('dl#field_id1 .field_uneditable:contains(Answer 1)').addClass('2ptsA'); // id1
  $('dl#field_id1 .field_uneditable:contains(Answer 2)').addClass('3ptsA'); // id1
  $('dl#field_id1 .field_uneditable:contains(Answer 3)').addClass('4ptsA'); // id1
  $('dl#field_id1 .field_uneditable:contains(Answer 4)').addClass('5ptsA'); // id1
 
  //Question 2 Answers
  $('dl#field_id2 .field_uneditable:contains(Answer 1)').addClass('2ptsB'); // id2
  $('dl#field_id2 .field_uneditable:contains(Answer 2)').addClass('3ptsB'); // id2
  $('dl#field_id2 .field_uneditable:contains(Answer 3)').addClass('4ptsB'); // id2
  $('dl#field_id2 .field_uneditable:contains(Answer 4)').addClass('5ptsB'); // id2

  if ( a.hasClass('2ptsA') && b.hasClass('2ptsB') || a.hasClass('2ptsA') && b.hasClass('3ptsB') || a.hasClass('3ptsA') && b.hasClass('2ptsB') ) {
    $('table#resultTest').addClass('groupA');
  } else if ( a.hasClass('3ptsA') && b.hasClass('3ptsB') || a.hasClass('2ptsA') && b.hasClass('4ptsB') || a.hasClass('4ptsA') && b.hasClass('2ptsB') || a.hasClass('4ptsA') && b.hasClass('3ptsB') || a.hasClass('3ptsA') && b.hasClass('4ptsB') || a.hasClass('2ptsA') && b.hasClass('5ptsB') || a.hasClass('5ptsA') && b.hasClass('2ptsB') ) {
    $('table#resultTest').addClass('groupB')
  } else if ( a.hasClass('4ptsA') && b.hasClass('4ptsB') || a.hasClass('3ptsA') && b.hasClass('5ptsB') || a.hasClass('5ptsA') && b.hasClass('3ptsB') || a.hasClass('4ptsA') && b.hasClass('5ptsB') || a.hasClass('5ptsA') && b.hasClass('4ptsB') ) {
    $('table#resultTest').addClass('groupC')
  } else if ( a.hasClass('5ptsA') && b.hasClass('5ptsB') ) {
    $('table#resultTest').addClass('groupD')
  }
});

Modifications:
Now as you can see in the javascript you can see the possible answers of the 2 fields. Now depending on the answers you added, please change the text in the parenthesis.
Also i have added some id1 and id2 comments in there to locate the parts where the 2 fields are. Now to indicate those fields ids go to your profile, find the question fields, right click > inspect element and check what id they are under:
Example:

After you do those modifications, click Submit.

CSS

Lastly you have to add this CSS:
Code:
table#resultTest.groupA:before{content:'Group A'}
table#resultTest.groupB:before{content:'Group B'}
table#resultTest.groupC:before{content:'Group C'}
table#resultTest.groupD:before{content:'Group D'}
and change the group names as you want.





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Kami-sama on January 5th 2017, 10:46 pm

Well instructions seamed simple enough. But the result does not change.
I am positive, that IDs are correct and answers match.

Also, maybe it is possible to use simple math, rather than classes? It would be more simple, just to add values to an argument and then check IF r>=10, else if r>=5, else if r>=0

Also, what's the outcome if user selects "no choice".
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

In progress Re: Sorting member to group upon registration

Post by Luffy on January 5th 2017, 10:58 pm

Nothing will show if they don't select anything. Now because i added classes i thought it would be simple enough like that. But because it doesn't sum anything due to class additions i didn't add any rules.

What are the answers you added? Also what are the fields ids and what script you use now? Just to make sure everything is okay.. Wink





avatar
Luffy
Manager
Manager

Male Posts : 4866
Reputation : 492
Language : Greek, English
Location : Greece

http://thinktank.forumotion.com/

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum