01-24-2001, 11:16 AM
Hello,
i have at the moment ca. 74 UserGroups on my Board.
Every Day I have 2 new UserGroups.
When I add a new private Forum , only the 4 Standard Groups have the Permisson "Can View Board = NO"
All other Groups i must change the Permisson manual :(
Now I need a Hack for the forum.php3 to add the Permission "Can View Board = NO" to all existing Groups.
I have found the follow Code in forum.php3:
if ($private==1) {
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=1");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,1,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=2");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,2,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=3");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,3,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=4");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,4,$forumid,0,0,0,0,0,0,0,0,0,0)");
}
Can anyone help me to make a Code for my Problem.
I have test the follow Code , but now in every Group I have 3 Permissions for the same Board.
if ($private==1) {
$dbresult=mysql_query("SELECT usergroupid FROM usergroup");
while($zeile=mysql_fetch_array($dbresult)){
$usergroupid=chop($zeile["usergroupid"]);
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=$usergroupid");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,$usergroupid,$forumid,0,0,0,0,0,0,0,0,0,0)");
echo "Hiding fuer Usergroup $usergroupid erfolgreich :)";
}
Thx for any Help.
i have at the moment ca. 74 UserGroups on my Board.
Every Day I have 2 new UserGroups.
When I add a new private Forum , only the 4 Standard Groups have the Permisson "Can View Board = NO"
All other Groups i must change the Permisson manual :(
Now I need a Hack for the forum.php3 to add the Permission "Can View Board = NO" to all existing Groups.
I have found the follow Code in forum.php3:
if ($private==1) {
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=1");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,1,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=2");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,2,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=3");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,3,$forumid,0,0,0,0,0,0,0,0,0,0)");
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=4");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,4,$forumid,0,0,0,0,0,0,0,0,0,0)");
}
Can anyone help me to make a Code for my Problem.
I have test the follow Code , but now in every Group I have 3 Permissions for the same Board.
if ($private==1) {
$dbresult=mysql_query("SELECT usergroupid FROM usergroup");
while($zeile=mysql_fetch_array($dbresult)){
$usergroupid=chop($zeile["usergroupid"]);
$usergroup=$DB_site->query_first("SELECT title,usergroupid,canview,cansearch,canemail,canpo stnew,canreply,canadminedit,canedit,candelete,cano penclose,canmove,cancontrolpanel FROM usergroup WHERE usergroupid=$usergroupid");
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,usergroupid,forumid,canview,can search,canemail,canpostnew,canreply,canadminedit,c anedit,candelete,canopenclose,canmove) VALUES (NULL,$usergroupid,$forumid,0,0,0,0,0,0,0,0,0,0)");
echo "Hiding fuer Usergroup $usergroupid erfolgreich :)";
}
Thx for any Help.