Support ⇒ Troubleshootings :: Archives ⇒ how to put every member in a group? :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexTroubleshootings

Archived ⇒ how to put every member in a group?


Hey guys....

is the following...

in my site, i have some groups, where my members are.
i know that the members can be in more than one group at the same time.

Now i created a group and i want to include All my members on it, without changing the group they already have.

I´ve looked in the db but didnt find where this information is....

how can i do this???

Thanks Guys

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37 (Unix)/5.0.24-standard/5.1.4/ CPG 9.1.1


Well, you can add manualy every member to your new group.
But if you are choosing somewhere, to who to show block/module/forumcategory or whatever, then there is also possibility to choose members, so you wouldn't need an extra group in that case.

EDIT: Also check the Wiki article "How to Add a User to a Dragonfly Group"

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


is there any way to make it at once??

because i cant include all the 300 members one by one.....


can i edit the db or something like this???

thanks

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37 (Unix)/5.0.24-standard/5.1.4/ CPG 9.1.1


Let me ask....the problem is the following...

i have the downloads pro.
i want to all my groups can download the files, except the anonymous and the registred members....

all the others group can download....

but in the options, i only can chose 1 group that is allowed to download.

so my options are:

1) put everyone in a group, so i can let new members to register and this new members CANT download.

2) Have a way to select more than one group in the alloed groups to download.....


Thanks Guys

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37 (Unix)/5.0.24-standard/5.1.4/ CPG 9.1.1


no one can help??

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37 (Unix)/5.0.24-standard/5.1.4/ CPG 9.1.1


Place this in a file like group_add.php in your root directory,<?php /************************************************************** * Backup your database first * This will include suspended members * This assumes Anonymous is your first member * Run the program one time only in your root directory * Check the cms_bbuser_group table BEFORE and AFTER * If it looks incorrect, restore that table from the backup * Delete the file after using it * * USE AT YOUR OWN RISK - NO GUARANTEES GIVEN **************************************************************/ include('includes/cmsinit.inc'); $group_id = 99; // Change this number to your new group number $members = 99; // Change this number to your number of members for ($i = 2; $i <= $members; $i++) { $db->sql_query("INSERT INTO ".$prefix."_bbuser_group (group_id, user_id, user_pending) VALUES ('$group_id', '$i', 0)"); echo 'Member '.$i.' added to Group '.$group_id.'<br />'; } echo '<br />Finished - check the above listing and your cms_bbuser_group table';

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux / apache 2.2.22 / mysqli 5.6.34 / 7.1.22 / 10.0.48.9418+


Phoenix....

It Worked.....
Thanks...you helped me a lot...


Thanks again guys

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.37 (Unix)/5.0.24-standard/5.1.4/ CPG 9.1.1


Well done, Phoenix!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


"INSERT INTO ".$prefix."_bbuser_group (group_id, user_id, user_pending) SELECT $group_id, user_id, 0 FROM ".$prefix."_users

This will add everyone in one go Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Greetings all,

For some reason I keep getting an parse error, unexpected $ on line 29.. Funny I don't have a line 29... The code stops at line 28

Any suggestions?

Thanks,

-- The only easy day was yesterday! --

Sweetbomb

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux - 2.6.14.7/MySQL - 4.1.20/PHP 4.3.11/DF - 9.1.2.1


You edited the script and it has a bug due to that.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


<?php
/**************************************************************
* Backup your database first
* This will include suspended members
* This assumes Anonymous is your first member
* Run the program one time only in your root directory
* Check the cms_bbuser_group table BEFORE and AFTER
* If it looks incorrect, restore that table from the backup
* Delete the file after using it
*
* USE AT YOUR OWN RISK - NO GUARANTEES GIVEN
**************************************************************/

include('includes/cmsinit.inc');
$group_id = 10; // Change this number to your new group number
$members = 266; // Change this number to your number of members


for ($i = 2; $i <= $members; $i++) {
$db->sql_query("INSERT INTO ".$prefix."_bbuser_group (group_id, user_id, user_pending)
VALUES ('$group_id', '$i', 0)");
echo 'Member '.$i.' added to Group '.$group_id.'<br />';
}

echo '<br />Finished - check the above listing and your cms_bbuser_group table';


Here is what my file looks like... I only added the group number and the number of members...

I was also interested in adding the one step option that was posted as well but was not sure where to add that in the script...
"INSERT INTO ".$prefix."_bbuser_group (group_id, user_id, user_pending)
SELECT $group_id, user_id, 0 FROM ".$prefix."_users

Thank you very much for any help...

Regards,

-- The only easy day was yesterday! --

Sweetbomb

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux - 2.6.14.7/MySQL - 4.1.20/PHP 4.3.11/DF - 9.1.2.1


Try again

<?php /************************************************************** * Backup your database first * This will include suspended members * This assumes Anonymous is your first member * Run the program one time only in your root directory * Check the cms_bbuser_group table BEFORE and AFTER * If it looks incorrect, restore that table from the backup * Delete the file after using it * * USE AT YOUR OWN RISK - NO GUARANTEES GIVEN **************************************************************/ include('includes/cmsinit.inc'); $group_id = 10; // Change this number to your new group number $db->sql_query("INSERT INTO {$prefix}_bbuser_group (group_id, user_id, user_pending) SELECT $group_id, user_id, 0 FROM {$prefix}_users"); echo '<br />Finished - check the above listing and your cms_bbuser_group table';

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Thank you very much DJ... That worked... Support here is excellent...

Again a big Thank you...

-- The only easy day was yesterday! --

Sweetbomb

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux - 2.6.14.7/MySQL - 4.1.20/PHP 4.3.11/DF - 9.1.2.1

All times are UTC