Advertisement:

Author Topic: Allowing guests to see all Boards but not entering  (Read 244708 times)

Offline Chelle

  • Semi-Newbie
  • *
  • Posts: 35
  • G33k Fu is my martial art
Re: Allowing guests to see all Boards but not entering
« Reply #60 on: August 11, 2005, 12:03:02 PM »
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

Offline mrandall131

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
    • Killing Authority
Re: Allowing guests to see all Boards but not entering
« Reply #61 on: August 12, 2005, 04:56:15 AM »
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.

Offline Dinagyang

  • Semi-Newbie
  • *
  • Posts: 48
Re: Allowing guests to see all Boards but not entering
« Reply #62 on: August 16, 2005, 08:22:35 AM »
you could do something like this...

open Display.template.php

look for:
Code: [Select]
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

add after:
Code: [Select]
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:
Code: [Select]
?>

and add above it:
Code: [Select]
}


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
« Last Edit: August 16, 2005, 08:24:09 AM by berlin »

Offline OlliMuc

  • Semi-Newbie
  • *
  • Posts: 35
Re: Allowing guests to see all Boards but not entering
« Reply #63 on: August 17, 2005, 09:53:29 AM »
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.

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Allowing guests to see all Boards but not entering
« Reply #64 on: August 26, 2005, 10:10:34 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?

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Allowing guests to see all Boards but not entering
« Reply #65 on: August 27, 2005, 07:49:18 AM »
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.....

« Last Edit: August 27, 2005, 06:39:26 PM by Brasileira »

Offline Carlos Gandra

  • Jr. Member
  • **
  • Posts: 161
  • Gender: Male
    • carlosgandra on Facebook
    • @_ac99 on Twitter
    • Carlos Gandra
Re: Allowing guests to see all Boards but not entering
« Reply #66 on: August 29, 2005, 01:53:47 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

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,280
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Allowing guests to see all Boards but not entering
« Reply #67 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
« Last Edit: September 01, 2005, 12:53:26 PM by elmacik »
Home of Elmacik

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Allowing guests to see all Boards but not entering
« Reply #68 on: August 29, 2005, 03:53:37 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)..

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Allowing guests to see all Boards but not entering
« Reply #69 on: August 29, 2005, 03:59:13 AM »
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.

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Allowing guests to see all Boards but not entering
« Reply #70 on: August 29, 2005, 11:57:42 AM »
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.

Offline Carlos Gandra

  • Jr. Member
  • **
  • Posts: 161
  • Gender: Male
    • carlosgandra on Facebook
    • @_ac99 on Twitter
    • Carlos Gandra
Re: Allowing guests to see all Boards but not entering
« Reply #71 on: August 29, 2005, 03:56:42 PM »
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
« Last Edit: August 29, 2005, 09:04:13 PM by ac99 »
Carlos Gandra
Mundo dos Animais

Offline Carlos Gandra

  • Jr. Member
  • **
  • Posts: 161
  • Gender: Male
    • carlosgandra on Facebook
    • @_ac99 on Twitter
    • Carlos Gandra
Re: Allowing guests to see all Boards but not entering
« Reply #72 on: August 29, 2005, 11:17:09 PM »
Problem solved!

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

Thanks
Carlos Gandra
Mundo dos Animais

Offline jdougher

  • Jr. Member
  • **
  • Posts: 299
    • PoetryCircle
Re: Guests
« Reply #73 on: September 01, 2005, 12:21:40 PM »
For Sources/MessageIndex.php, find:

Code: [Select]
$user_info[query_see_board]
Replace with:

Code: [Select]
($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.

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,280
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Guests
« Reply #74 on: September 01, 2005, 12:51:43 PM »
For Sources/MessageIndex.php, find:

Code: [Select]
$user_info[query_see_board]
Replace with:

Code: [Select]
($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.
« Last Edit: September 01, 2005, 12:54:53 PM by elmacik »
Home of Elmacik

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Allowing guests to see all Boards but not entering
« Reply #75 on: September 02, 2005, 05:50:01 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..

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,280
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Allowing guests to see all Boards but not entering
« Reply #76 on: September 02, 2005, 08:23:33 AM »
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:
Code: [Select]
WHERE $user_info[query_see_board]
add after:
Code: [Select]
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
« Last Edit: September 02, 2005, 08:32:44 AM by elmacik »
Home of Elmacik

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Allowing guests to see all Boards but not entering
« Reply #77 on: September 02, 2005, 12:59:25 PM »
You want to replace this:

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


With:

Code: [Select]
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.

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,280
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Allowing guests to see all Boards but not entering
« Reply #78 on: September 02, 2005, 03:16:32 PM »
You want to replace this:

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


With:

Code: [Select]
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

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Allowing guests to see all Boards but not entering
« Reply #79 on: September 02, 2005, 07:52:53 PM »
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.
« Last Edit: September 02, 2005, 07:54:52 PM by Jay T »