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.
Sign In
Not a member yet? Click here to register.

User Groups - When registering

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

CodeDownload  
 <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_shouts-stat_include_var.php
| Author: PHP-Fusion 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

CodeDownload  
 <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_shouts-stat_include.php
| Author: PHP-Fusion 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);
 }

}

Thread Information
Author
Replies
1 post
Views
137 times
Last Post
Last updated on 2 months ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: jjwichter