user choice FEU group assignment (FEU subscription Mod)
Posted: Wed Jan 14, 2009 2:40 am
Hello, so before I get in on the other task I have which is editing the news on the front side, i found I need to do something first... I'm hoping that I may have over looked something but I have a need for a use to chose the group they belong to as well as be in the one I tell them to be in... plus this needs to be importable, which looks to me like you can only have one group to choose on import...
So after much reading and thinking on this I came up with this... I need to have a UDT attached to the Frontend User Management Event Name: OnCreateUser. This way If I've read everything right I should be able to have the user pick a group via user Properties dropdown, and on import... so this is what I wrote out so far but I'm a little stuck.. before I can do much else I need to get these worked out... I'm sure I’m just missing something..
I have a user Property dropdown called, shrine_club with
option_name:
Members
Moderator
CDA
Latah
Moyie
Panhandle
Shoshone
StMaries
Units
Public
And
table cms_module_feusers_groups:
id groupname
1 Members
13 Moderator
3 CDA
4 Latah
5 Moyie
6 Panhandle
7 Shoshone
8 StMaries
12 Units
11 Public
Any help or pointers would be great...
thank you
jeremyBass
*CMSMS1.5.1 and FrontEndUsers1.5.4*
So after much reading and thinking on this I came up with this... I need to have a UDT attached to the Frontend User Management Event Name: OnCreateUser. This way If I've read everything right I should be able to have the user pick a group via user Properties dropdown, and on import... so this is what I wrote out so far but I'm a little stuck.. before I can do much else I need to get these worked out... I'm sure I’m just missing something..

I have a user Property dropdown called, shrine_club with
option_name:
Members
Moderator
CDA
Latah
Moyie
Panhandle
Shoshone
StMaries
Units
Public
And
table cms_module_feusers_groups:
id groupname
1 Members
13 Moderator
3 CDA
4 Latah
5 Moyie
6 Panhandle
7 Shoshone
8 StMaries
12 Units
11 Public
Code: Select all
<?
global $gCms;
$db = &$gCms->db;
$group_id = '';
$UDgroup = 'shrine_club';
$query = "SELECT * FROM ".cms_db_prefix()."module_feusers_users";
$dbresult = $db->Execute($query);
if ($dbresult && $dbresult->RecordCount() > 0)
{
$row = $dbresult->FetchRow();
$user_id = $row['id'];
}
$query2 = "SELECT * FROM ".cms_db_prefix()."module_feusers_groups";
$dbresult2 = $db->Execute($query2);
if ($dbresult2 && $dbresult2->RecordCount() > 0)
{
$row = $dbresult2->FetchRow();
$group_id = $row['id'];
}
$query3 = "SELECT * FROM ".cms_db_prefix()."module_feusers_properties WHERE userid=" .$user_id. " AND title=".$UDgroup;
$dbresult3 = $db->Execute($query3);
if ($dbresult3 && $dbresult3->RecordCount() > 0)
{
$row = $dbresult3->FetchRow();
$data =$row['data'];
}
switch($data)
{
case "CDA":
$dataVAL= "3";
case "Latah":
$dataVAL= "4";
case "Moyie":
$dataVAL= "5";
case "Panhandle":
$dataVAL= "6";
case "Shoshone":
$dataVAL= "7";
case "StMaries":
$dataVAL= "8";
break;
}
for($i=0;$i<count($data);$i++) {
if( $dataVAL = $group_id ){
$query = "INSERT INTO ".cms_db_prefix()."module_feusers_belongs (userid, groupid)
VALUES (".$userid.", ".$groupid.")";
$result = $db->Execute($query);
}
}
?>
thank you
jeremyBass
*CMSMS1.5.1 and FrontEndUsers1.5.4*