By Alexandre Cayer on Wednesday, 12 November 2014
Posted in Technical Issues
Replies 9
Likes 0
Views 729
Votes 0
Hi Guys,

I will create a custom field which purpose is to create its respective invited-only group and have a link to that group as a widget.

I have looked the group model file and check the store method to check if there was any other logic beside storing the table... however it is storing only the session table or pushed in view.

If I would to be storing a group with only :
name,
category id,
type id for invite only,
admin user id

Could that be working !? Just got lost.

Thanks

Alex
Hi,

Not quite sure what you are trying to achieve here. Please elaborate more.
·
Wednesday, 12 November 2014 12:45
·
0 Likes
·
0 Votes
·
0 Comments
·
k
I will create an "invisible" custom field which will be added to a specific profile type.
During the after saving event of the custom file, I want to be able to also create a group dynamically.
It will fetch the Profile name, the user ID of that just registered user, the group category will be preset in back-end and I want that group to be created to be invite-only.

Thus, I want to create with these params a new Group.

I wanted to know if i can just make an array with the param=>value and store it OR there is a much complex method/logic as to create a group out of the blue.

Alex
·
Wednesday, 12 November 2014 12:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

The process is a little bit more complicated because the values are stored in a key => value pair in which the key can be possibly anything, depending on the field. For instance, it can be "title" => "Group Title", and "es-fields-12", etc.

If you are only injecting basic details then you can actually just add an entry in #__social_clusters and #__social_clusters_nodes.
·
Wednesday, 12 November 2014 14:16
·
0 Likes
·
0 Votes
·
0 Comments
·
ok thanks I'll make a try tomorrow with this.

However, last question, you showed me the FD::ROUTE for user profile. If i get back that id from what is just have added what would the ROUTE for GROUP to fetch the url would be the exact same techniques array( type => groups, id => $id) ?
·
Wednesday, 12 November 2014 14:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

For groups: FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias()))), or just $group->getPermalink().
·
Wednesday, 12 November 2014 16:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Jason,

I checked the cluster table and got 2 questions:
a) Can i leave the params field empty without causing issues or this will jam up the whole thing ? If not what are the minimum param I have to set ?
b) What is the key field, how i set one and what is its usage ? (fetch the created group as to get the id !?!)
·
Thursday, 13 November 2014 14:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

1. Expectedly yes. If there are any issues, it wouldn't be the params being empty, it will be the receiver's problem (in which is a bug).

2. The key field works like a password field for user. It is used to validate actions such approve group through email. It is just a randomly created string, md5.
·
Friday, 14 November 2014 10:53
·
0 Likes
·
0 Votes
·
0 Comments
·
OK.
All is fine with setting no PARAMS, then edit the group and it doesn't mess up anywhere.

Hummm right now is any feature using the key ?!? I haven't seen any on front-end user side.
Here is my set:$group->key = md5($this->generateRandomString());
·
Friday, 14 November 2014 13:31
·
0 Likes
·
0 Votes
·
0 Comments
·
The key can be anything actually. It doesn't affect anything. It is only use as part of a parameter in the url in the email sent out to administrator to approve event, in which the value is then cross checked against the table.
·
Friday, 14 November 2014 16:52
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post