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?

Can i control a new thread ?

Asked Modified Viewed 3,781 times
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Hi,

i am planning to have a forum with php fusion and using it as a general committee forum.
Planning to do a school forum where i accept various school to register and have one representative here.
example..

forum
- school A (i select one representative, modA to only moderate this thread)
- school B (i select one representative, modB to only moderate this thread)
- school C (i select one representative, modC to only moderate this thread)

Problem now is i am setting up a few forum groups with :
- modA
- normaluserA
- modB
- normaluserB
- modC
- normaluserC


So when people register, i will confirm with user which school he or she belongs to, then only i will assign the selective group to him ( so that schoolA will be moderated by modA and only normaluserA is able to view the thread. - and not normaluserB / modB / normaluserC / modC )

problem now, when i limit the thread only modA and normaluserA is allowed to view / read schoolA... then when new user logs in, they do not have any idea if his or her school is listed in my forum ? If i remove that, then all normaluser and mod from B and C will be able to view posts from schoolA which i think this might not be that good too. My idea.. why would userB and userC goes to view and read schooA ?

so i am just wondering if there is any control i can apply or some modification i can do ?

i am thinking of... in thread... all users are able to view the thread / categories from main forum .. but when he or she clicks inside the thread... the system will check on its access right ? or maybe asking him or her to enter certain password to allow him or her goes in there ?

is this possible ?

thank you for reading this long description x.x
0 replies

13 posts

A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

The forum_id is the id for the Forum which you want the User Access to...

if ($_GET['forum_id'] == 20) {
means if the User is browsing the Forum with forum_id 20.

if (iMEMBER && (iUSER_GROUPS ==2 || !iUSER_GROUPS)) {
means if he is a member AND ( either he is from Group 2 OR a normal member )
0 replies
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Hi Ankur,

thanks for the help. . i have pmed you .. in case if you need further information.. you can directly find me in skype / gmail / here as well :) thanks

Merged on Jun 23 2011 at 08:47:02:
Hi Ankur..

i retest on it just now.. and found the flow seems working ...
maybe yesterday it was my misunderstanding..

tested with the selected group (wihtin the panel code) .. they are able to access
tested with the different group (wihtin the panel code) .. they are NOT able to access
tested with the member without group .. they are able to access
non-member.... totally cant see the forum :)

so like what you said earlier..

To see, it must be Member. Also, it must be either Assigned to a Group OR he is a Normal Member/Student which is not assigned to any School group yet...


when member without any groups.. they can see that forum too ? can i put it ..

if ($_GET['forum_id'] == 20) {
if (iUSER_GROUPS ==2 || !iUSER_GROUPS) {

so forum id = 20 will onli allow groups=2 to enter ONLI ? and not other group or no group member to access ?
thanks
Edited by zapdos_wk on 23-06-2011 09:47,
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

This looks very unusual because its working 100 % here I tested it... Did you changed the forum_id to the suitable forums and its ID's ?

It would be easy to help you if you will provide me with your Website Link with a Admin Account with Access to Forums and Panels... You can PM me the Details...
0 replies
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

hi Ankur,

i tried with the code you provided... and rename the panel to "Testing Forum Blocker"
from /members.php, i choose one of the user that the group is = 2, so i have the code changed

if ($_GET['forum_id'] == 20) {
if (iMEMBER && (iUSER_GROUPS ==2 || !iUSER_GROUPS)) {

when i click on the forum with the user group = 2 ( user A) ... user A is not able to click on the forum link.
when i tested a new user member.... user B (where B is just normal user and not yet assign any group to it) B is able to log in to the forum

I tested on another user group id = 3 ... not able to see the forum too.

this code if (iMEMBER && (iUSER_GROUPS ==2 || !iUSER_GROUPS)) { .. means .. member onli able to view the forum AND the group should be =2 .. then only will prommpt "You are assigned to User Group 1 and you are a Member";" right ?
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

On noticing the Image you attached, it is seen that you have selected a Panel file in that... Remember, Panel content will be ignored if it is selected..

Ok ! Try This Code :

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (isset($_GET['forum_id'])) {

openside("Testing Forum Blocker"wink;

if ($_GET['forum_id'] == 20) {
if (iMEMBER && (iUSER_GROUPS ==1 || !iUSER_GROUPS)) {
echo "You are assigned to User Group 1 and you are a Member";
}
else {
redirect(FORUM."index.php"wink;
}
}

if ($_GET['forum_id'] == 30) {
if (iMEMBER && (iUSER_GROUPS ==2 || !iUSER_GROUPS)) {
echo "You are assigned to User Group 2 and you are a Member";
}
else {
redirect(FORUM."index.php"wink;
}
}

closeside();
}[/syntaxhighlighter]
if (iMEMBER && (iUSER_GROUPS ==2 || !iUSER_GROUPS))
To see, it must be Member. Also, it must be either Assigned to a Group OR he is a Normal Member/Student which is not assigned to any School group yet...
0 replies
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Hi ,

previously i did try to add in the code but i was not seeing any difference about it.. but i will recheck shortly once i back home again.. in case if i have missed out anything earlier :)
thanks

Merged on Jun 22 2011 at 11:05:25:
Hi Ankur,

i tried it again and it seems the same .. am i doing a wrong thing here ?
refer to this attachment

www.nendoroiz.com/panel.jpg

i enabled the panel and tested with different user with different groups... all of them able to access the forum tho.

thanks
Edited by zapdos_wk on 22-06-2011 12:05,
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Thats is what I said, that you need not to Edit the core file viewforum.php. Just Add this Code in a Panel and enable it.

Quote

Note: Replace the Forum id's with the ones you want and edit it yourself to your needs ;)
0 replies
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Hi Ankur,

i am not sure if i understand it... so i will create new panel in admin panel and list down these code ?

if (isset($_GET['forum_id'])) {

if ($_GET['forum_id'] == 1) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group A') {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php");
}
}

if ($_GET['forum_id'] == 2) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group B') {
echo "Allow him to see Forum B";
}
else {
redirect(FORUM."index.php");
}
}

if ($_GET['forum_id'] == 3) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group C') {
echo "Allow him to see Forum C";
}
else {
redirect(FORUM."index.php");
}
}

}

(***i need to set my forum id here before i save it)

What does this panel meant for ?
or i need to paste this code in viewforum.php (core file ) ?

thanks
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Nah there is no need to Edit the Core files. Simple, make a Panel and Enable it with your Code.

For different schools, you can apply conditions like :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (isset($_GET['forum_id'])) {

if ($_GET['forum_id'] == 1) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group A'wink {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php"wink;
}
}

if ($_GET['forum_id'] == 2) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group B'wink {
echo "Allow him to see Forum B";
}
else {
redirect(FORUM."index.php"wink;
}
}

if ($_GET['forum_id'] == 3) {
if (!iUSER_GROUPS || iUSER_GROUPS =='Group C'wink {
echo "Allow him to see Forum C";
}
else {
redirect(FORUM."index.php"wink;
}
}

}[/syntaxhighlighter]
0 replies
Z
zapdos_wk
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Quote

Ankur wrote:

Or you can Simply try this condition :

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!iUSER_GROUPS || iUSER_GROUPS =='Group A') {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php");
}[/syntaxhighlighter]


thanks for the advise...

i added this in viewforum.php

if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php");
}


and it works as what i am expecting.. but something strikes in my mind.... means whenever user clicks on any link.. it will be sort of "fixed" type ?
or where should i put this code on ? do i need additional code further ?

example :

General
- school A (/viewforum.php?forum_id=1)
- school B (/viewforum.php?forum_id=2)
- school C (/viewforum.php?forum_id=3)

should i hardcode it somwhere else... so that i can define myself.. when viewforum.php?forum_id=1 is clicked... i can control who will be able to access that page ?



- school A (/viewforum.php?forum_id=1)
if (!iUSER_GROUPS || iUSER_GROUPS =='1' {
echo "Allow him to see school A";
}
else {
redirect(FORUM."index.php");
}

- school B (/viewforum.php?forum_id=2)
if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see school B";
}
else {
redirect(FORUM."index.php");
}

- school C (/viewforum.php?forum_id=3)
if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see school C";
}
else {
redirect(FORUM."index.php");
}



thank you
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Why though that does same as Groupaccess for forums?

Does iUSER_GROUPS exist in maincore now?



Edited by Craig on 20-06-2011 19:15,
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Or you can Simply try this condition :

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!iUSER_GROUPS || iUSER_GROUPS =='Group A'wink {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php"wink;
}[/syntaxhighlighter]
0 replies
M
MarcusG
M
Ex Senior Dev.
  • Member, joined since
  • Contributed 182 posts on the community forums.
  • Started 5 threads in the forums
answered
Member

Create another forum, visible for all registered users, and write a sticky thread with the information that the forums appear after the user is assigned to his school.

This would be the simplest solution without modifying any files.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 13 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
M
M
Ex Senior Dev.
  • Member, joined since
  • Contributed 182 posts on the community forums.
  • Started 5 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
Z
Z
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet