Allowing guests to see all Boards but not entering

Started by trenchteam, September 05, 2004, 11:19:01 PM

Previous topic - Next topic

Chelle

W00t! I just tackled this today..as I'm new to SMF and am setting things up.  You can do permissions by board for that

Permissions->Permissions by Membergroups [should be near the top]

You can designate access this way.

You can also get more specific about what membergroups can do in each board by going to:

Permissions->Permissions by Board [should be near the top]

For the boards you want limited access..click on Local

Now you can designate what each membergroup is allowed to do in that board and grant access or not.  If you use global, then the permissions set up when you create or modify just the Membergroups will apply.  Local overrides those settings.  Schway cool if you ask me.


..oh please correct as needed, but this is my understanding so far
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

mrandall131

Agreed, but if a member group isn't checked in the local settings, the board is not visible to that group either.  That's why you need to modify the code accordingly.

Dinagyang

#62
Quote from: -Diplömat- on January 17, 2005, 08:44:46 PM
you could do something like this...

open Display.template.php

look for:

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;


add after:

if ($context['user']['is_guest'])
{
echo '
<div align="center">Please login or register to view topics</div>';
}
else
{


then look for at the very bottom:

?>


and add above it:

}



that should work


It works but I get this error.

Fatal error: Call to undefined function: theme_show_mod_buttons() in /home/dinagyan/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 596

OlliMuc

Hi there!

I've just tried a few different ways to solve the "Have a look at it, but do not enter"  ;) problem mentioned in this thread, but somehow I don't seem to make any progress. I've changed the $user_info[query... bits in the messageindex.php as mentioned by Unknown, but after setting guests to "no access", they still can't see the board - even after the modification. Maybe I'm a bit too blind here to find the solution, so I'd be very grateful if somebody could help out.

BTW: This would be really great for a modification! Something to make SMF really complete - it's about the only feature I miss there that other forum software has.

Jay T

Quote from: -Diplömat- on December 04, 2004, 07:12:15 PM
anyway that could be done but also block them from seeing the last post that was in that board...so instead if it saying:

Date
In: Wow, what a game!!!!
By: Diplomat

they see something like

Date
Protected Board

Can someone code this?

JustJa

#65
I used this code:
By Forgyx
It works nice, The board entitled to the guys that posts more is visible but not possible to enter to the others, but I would like it to work only on this board not on all of them...
the other one that is just for moderators I want to be hidden.
How can i code this???
Help.....


Carlos Gandra

Quote from: Kramer on August 11, 2005, 11:26:46 AM
All right, I'm pretty green when it comes to codes. I want guests to be able to view all the boards on my forum, but I want to block access only to some of my boards, not all of them. Is this possible?

I'm having the same problem.

One of my boards, that is restricted to admins and mods has become visible to all and all registed users could enter with their login. Permissions are right, guests and members are uncjecked to access, only mods and admins could see and use, but when I have used the [Unknown] code, it happens.... all have gained permissions to read the content of restricted board.

Could you help me fix that? I have restore the files backup because I don't want that all see the mods board!
Carlos Gandra
Mundo dos Animais

Elmacik

#67
i think the best one is the [unknown]'s
http://www.simplemachines.org/community/index.php?topic=16281.msg193474#msg193474

i use it with different themes, works perfect
Home of Elmacik

JustJa

Quote from: elmacik on August 29, 2005, 01:59:59 AM
i think the best one is the [unknown]'s
http://www.simplemachines.org/community/index.php?topic=16281.msg135394#msg135394

i use it with different themes, works perfect

Yes, it worked very good on my linux server,
but i don´t know why it gives this error on the windows server :

"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (1)
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1

File: C:\home\kunder\5051\brassar.se\forum\Sources\BoardIndex.php
Line: 82

Note: It appears that your database may require an upgrade. Your forum files are currently at version SMF 1.0.5, whereas your database is at version SMF 1.0.2. It is recommended that you execute the latest version of upgrade.php"


It is strange ´cause the databases are th[/color]e same... (I use the linux server to do the testing first)..

JustJa

opsss :-[.
Maybe it was some coincidense?
I changed back the code but the error is still there...
I have
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);
on my line 82.

Jay T

Quote from: Jay T on August 26, 2005, 10:10:34 PM
Quote from: -Diplömat- on December 04, 2004, 07:12:15 PM
anyway that could be done but also block them from seeing the last post that was in that board...so instead if it saying:

Date
In: Wow, what a game!!!!
By: Diplomat

they see something like

Date
Protected Board

Can someone code this?

Anyone, this is much needed.

Carlos Gandra

#71
Quote from: ac99 on August 29, 2005, 01:53:47 AM
Quote from: Kramer on August 11, 2005, 11:26:46 AM
All right, I'm pretty green when it comes to codes. I want guests to be able to view all the boards on my forum, but I want to block access only to some of my boards, not all of them. Is this possible?

I'm having the same problem.

One of my boards, that is restricted to admins and mods has become visible to all and all registed users could enter with their login. Permissions are right, guests and members are uncjecked to access, only mods and admins could see and use, but when I have used the [Unknown] code, it happens.... all have gained permissions to read the content of restricted board.

Could you help me fix that? I have restore the files backup because I don't want that all see the mods board!

Im' sorry by incovenience but this is very urgent for my community!
It appears that, if I want guest's to see but not entering, I've to delete the admin and mod boards, and I don't want it :'(

Thanks
Carlos Gandra
Mundo dos Animais

Carlos Gandra

Problem solved!

The answer is already here by [Unknown], allow to show individual boards.

Thanks
Carlos Gandra
Mundo dos Animais

jdougher

Quote from: [Unknown] on September 18, 2004, 03:45:57 PM
For Sources/MessageIndex.php, find:

$user_info[query_see_board]

Replace with:

($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")

-[Unknown]

This change didn't work on my site www.photocamel.com at all.

Any suggestions?

Thanks.

Elmacik

#74
Quote from: jdougher on September 01, 2005, 12:21:40 PM
Quote from: [Unknown] on September 18, 2004, 03:45:57 PM
For Sources/MessageIndex.php, find:

$user_info[query_see_board]

Replace with:

($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")

-[Unknown]

This change didn't work on my site www.photocamel.com at all.

Any suggestions?

Thanks.


i think you got the wrong modifications.
look at this;
Quote from: [unknown]
Sources/BoardIndex.php, find:

Code:

WHERE $user_info[query_see_board]


Replace with:

Code:

WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")


Where ##, ##, ## is a list of board IDs.

dont forget to to UNCHECK the guest permission into the boards that you want them to see but not enter.
Home of Elmacik

JustJa

Quote from: elmacik on August 29, 2005, 01:59:59 AM
i think the best one is the [unknown]'s
http://www.simplemachines.org/community/index.php?topic=16281.msg193474#msg193474

i use it with different themes, works perfect
yes it works perfectly this one, to the guests.
But how can I make it block all the other groups, exept the "charter". Because now the only group that can see but not come in is the guests. I wanted to make it to the ungrouped and two other groups as well..

Elmacik

#76
yes this is something i want too.
i think adding more codes like this will work;  (i havent tried yet)

in /Sources/BoardIndex.php

find: WHERE $user_info[query_see_board]

add after: WHERE ($user_info[query_see_board]" . ($user_info['is_charter'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")

pay attention to the word "charter" in the code. i think you can use it for all the groups.
i will try it. wait to see if coders will confirm these (sorry for the wrong words but i think you understand what i mean :) )

edit:look what [unknown] says;

add something like;

AND $user_info[query_see_board]

(add this after the codes you added before)
i couldnt understand how to use :P
Home of Elmacik

Jay T

You want to replace this:

WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);



With:

WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (12, 13, 27)" : ' OR b.ID_BOARD IN (12, 13, 27)') . ')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);


Just change the board numbers to yours and then use permissions for allowing different groups access.

Elmacik

Quote from: Jay T on September 02, 2005, 12:59:25 PM
You want to replace this:

WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);



With:

WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (12, 13, 27)" : ' OR b.ID_BOARD IN (12, 13, 27)') . ')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);


Just change the board numbers to yours and then use permissions for allowing different groups access.


this is still for only guests  ::)
Home of Elmacik

Jay T

#79
No it isn't. I use this mod on my boards and it works great. I have a forum for moderators only but I let the regular members see that it exist, makes them jealous. 8)

In permissions, only give access to the groups you want to be able to enter it.

Whatever group you take the access from will only be able to see it. If they try to enter it they will get an error message saying they don't have access.

Advertisement: