Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

User Groups - When registering

Asked Modified Viewed 842 times
J
jjwichter
J
  • Member, joined since
  • Contributed 97 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions
asked
Member

Deviance made a custom user field so that when the end user signs up to be a member of my site they can pick what user level they can be in. When I installed it and tested the user field by picking the group to be in. It went to the default member as the group not what I picked. Here is the files I hope someone can help me figure what is going on with the custom code.

User_groups_reg_include_var.php

 <?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_shouts-stat_include_var.php
| Author: PHPFusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
 die("Access Denied");
}

// Version of the user fields api
$user_field_api_version = "1.01.00";
$user_field_name = $locale['uf_ug'];
$user_field_desc = $locale['uf_ug_desc'];
$user_field_dbname = "user_groups_reg";
$user_field_group = 2;
$user_field_dbinfo = "TINYINT(1) NOT NULL DEFAULT '0'";



User_groups_reg_include.php

 <?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_shouts-stat_include.php
| Author: PHPFusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
 die("Access Denied");
}

if ($profile_method == "input" && !$field_value) {

 if (iGUEST || iSUPERADMIN) {
 static $recache = [];

 $groups = fusion_get_groups();
 // print_p($groups);

 if (empty($recache) && !empty($groups)) {
 foreach($groups as $group_id => $group) {
 if ($group_id > 0) {
 $recache[$group_id] = $group;
 }
 }
 }

 $options = [
 'inline' => TRUE,
 'placeholder' => $locale['uf_ug'],
 'error_text' => $locale['uf_ug_error'],
 'options' => $recache,
 // 'tags' => TRUE,
 'width' => '100%',
 'inner_width' => '100%',
 'delimiter' => '.',
 ] + $options;
 $user_fields = form_select('user_groups', $locale['uf_ug'], $field_value, $options);
 }

}
Edited by jjwichter on 01-09-2019 16:43,
0 replies
There are no post found.

Labels

None yet

Statistics

  • Views 0 views
  • Posts 0 posts
  • Votes 0 votes
  • Topic users 1 member

1 participant

J
J
  • Member, joined since
  • Contributed 97 posts on the community forums.
  • Started 29 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet