Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: trenchteam on September 05, 2004, 11:19:01 PM

Title: Allowing guests to see all Boards but not entering
Post by: trenchteam on September 05, 2004, 11:19:01 PM
I want guests to be able to see all the boards, but when the click the board, its says they have no access to it without login. How do I do this. WHen i set permissons in the admin, when your a guest the board just doesnt appear at all to them.   I want it to be able to be seen, but disable access until they are registered.  not sure if this makes sense.

[edit] changed topic title [/edit]
Title: Re: Guests
Post by: [Unknown] on September 05, 2004, 11:37:51 PM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]
Title: Re: Guests
Post by: CapriSkye on September 05, 2004, 11:51:57 PM
ha i thought you could just do this with the permissions...but i guess not
Title: Re: Guests
Post by: trenchteam on September 05, 2004, 11:54:07 PM
thanks. worked perfectly.
Title: Re: Guests
Post by: trenchteam on September 06, 2004, 12:02:26 AM
ha i thought you could just do this with the permissions...but i guess not
No it doesnt. I attempted that.  Didn't work.
Title: Re: Guests
Post by: [Unknown] on September 18, 2004, 03:45:57 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]
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 01, 2004, 09:44:13 AM
and allow all member's group to view all board?

for example:
now, with this mod, a guest can view a board for registred members but its says they (guests) have no access to it without login.. ok!...
 but if a board is for supermoderator only? Guest and registred members not see it  :(

i want that all board are visible for all user...

who's able to help me?

(excuse for may bad english!  :P)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on December 01, 2004, 10:20:49 AM
Why do you want a board for super moderators to be visible to guests and all registered members who can't post in it?
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 02, 2004, 09:48:14 AM
ehm..
i've create a forum for Vip (user with 40 posts) and i want that this forum is visible for all (but non entering/access)!!
smf has many option for permission but it hasn't most important permission (like ipb2)
i hope so  ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on December 02, 2004, 09:59:29 AM
I'll see what I can come up with, but I still don't understand why you'd want a board to be visible to everyone who can't post there...
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 02, 2004, 10:52:50 AM
because i want it  ;D

for me: if a user view a forum inaccessible but  interesting, he is induces to post and post and post  ;)
but if a forum is hided the user go out from site!  :'(
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on December 02, 2004, 10:57:12 AM
Ok. Give me a minute to look at something and see what I can do here...
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on December 02, 2004, 10:59:52 AM
Ok. Try this and see if it works.

Sources/BoardIndex.php

Find
Code: [Select]
WHERE $user_info[query_see_board]
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

Replace
Code: [Select]
WHERE $user_info[query_see_board] || b.ID_BOARD = '{boardid}'
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

Just replace {boardid} with the ID number of the board you want them to see. I think that will work, but if it doesn't, let me know.
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 02, 2004, 12:08:22 PM
thank's but it doesn't works  :(
the forum id that i choice doesn't shows, and board index show all other forums 3 times  ??? ::)
(if it works is possible to choice many forum id to show?)
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 02, 2004, 12:33:23 PM
Wow! I find a solution!
I don't believe in myself!!!

well, in boardindex.php i changed:
Code: [Select]
WHERE $user_info[query_see_board]
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);


with:
Code: [Select]
WHERE  b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

it's work, now all forum are visible (only eheh ;D)

thank's Oldiesmann for lost time with me....
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on December 02, 2004, 01:31:00 PM
As long as you don't mind letting all users see every board, that will work just fine. I thought $user_info[query_see_board] returned either TRUE or FALSE, but maybe it doesn't... Anyway, just for future reference, here's how you would accomplish this:

Sources/Load.php

Find
Code: [Select]
// Just build this here, it makes it easier to change/use.
if ($user_info['is_guest'])
$user_info['query_see_board'] = 'FIND_IN_SET(-1, b.memberGroups)';
// Administrators can see all boards.
elseif ($user_info['is_admin'])
$user_info['query_see_board'] = '1';

Replace
Code: [Select]
// Administrators (and guests) can see all boards. (Guests get a "you have to register" message :D)
if ($user_info['is_admin'] || $user_info['is_guest'])
$user_info['query_see_board'] = '1';
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on December 02, 2004, 04:44:39 PM
well! the guest and Admin view all boards, but a Junior Member (10posts) not see a forum for Vip Member (60 posts)... (or for moderator's category)
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on December 02, 2004, 04:51:02 PM
It is often a much longer string.  You want to use parenthesis when doing ORs in queries.

Remember...

x AND y OR z AND v

Is what you had.  But, what you want is:

x AND (y OR z) AND v

There's a huge difference.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Trekkie101 on December 02, 2004, 05:27:46 PM
AND

0   0    0
0   1    0
1   0    0
1   1    1

OR

0    0   0
0    1   1
1    0   1
1    1   1

Dunno why was just needed, lol, ask for more if you want.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on December 03, 2004, 02:59:03 AM
http://www.simplemachines.org/community/index.php?topic=12577.0#msg123148
Title: Re: Allowing guests to see all Boards but not entering
Post by: diplomat. on December 04, 2004, 07:12:15 PM
Wow! I find a solution!
I don't believe in myself!!!

well, in boardindex.php i changed:
Code: [Select]
WHERE $user_info[query_see_board]
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);


with:
Code: [Select]
WHERE b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

it's work, now all forum are visible (only eheh ;D)

thank's Oldiesmann for lost time with me....


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
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on January 14, 2005, 09:38:38 PM
Has anyone been able to figure out how to just show individual boards?
Title: Re: Guests
Post by: [Unknown] on January 15, 2005, 04:00:02 AM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")
Where ##, ##, ## is a list of board IDs.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on January 16, 2005, 07:35:27 PM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")
Where ##, ##, ## is a list of board IDs.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]

It works (I had to uncheck guest access to the board I wanted to showcase). It doesn't quite work with childboards, as a guest, the childboards are visible in the board index but not visible in the message index.
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on January 17, 2005, 01:04:57 AM
You have to change MessageIndex.php too for the child boards to show from there.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on January 17, 2005, 06:16:00 AM
You have to change MessageIndex.php too for the child boards to show from there.

-[Unknown]

I'm not quite sure which one of these lines to edit since the "WHERE $user_info[query_see_board]" line isn't present in the MessageIndex.php:

Code: [Select]
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE b.childLevel = " . ($board_info['child_level'] + 1) . "
AND b.ID_PARENT = $board
AND $user_info[query_see_board]
ORDER BY b.boardOrder", __FILE__, __LINE__);
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on January 17, 2005, 06:17:46 AM
Same thing:

AND $user_info[query_see_board]

Just replace it with the same thing, but use AND instead of WHERE.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on January 17, 2005, 06:53:10 AM
Same thing:

AND $user_info[query_see_board]

Just replace it with the same thing, but use AND instead of WHERE.

-[Unknown]

It worked, thanks!
Title: Re: Allowing guests to see all Boards but not entering
Post by: IaGcT on January 17, 2005, 04:17:26 PM
As long as you don't mind letting all users see every board, that will work just fine. I thought $user_info[query_see_board] returned either TRUE or FALSE, but maybe it doesn't... Anyway, just for future reference, here's how you would accomplish this:

Sources/Load.php

Find
Code: [Select]
// Just build this here, it makes it easier to change/use.
if ($user_info['is_guest'])
$user_info['query_see_board'] = 'FIND_IN_SET(-1, b.memberGroups)';
// Administrators can see all boards.
elseif ($user_info['is_admin'])
$user_info['query_see_board'] = '1';

Replace
Code: [Select]
// Administrators (and guests) can see all boards. (Guests get a "you have to register" message :D)
if ($user_info['is_admin'] || $user_info['is_guest'])
$user_info['query_see_board'] = '1';

I don't know if it's just me, but for some reason I did this and the guests don't get a "You have to register" message. I put in all the code from the previous posts, too. Under "Edit Features and Options", am I supposed to check off "Allow guests to browse forums"? Because with this on, when I log out and I'm a guest, I can see all the boards and topics and stuff.
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on January 17, 2005, 04:31:42 PM
Umm, this is specifically to make that happen.  If you want them to be able to view the board, just use regular access permissions.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: IaGcT on January 17, 2005, 07:30:22 PM
Sorry... I think you misunderstood...

What I mean is that a guest can browse the forums. When he/she clicks on a board, he/she can read all the posts, but can't post a reply or make a new topic.

What I was trying to do is to have a guest browse the forums and then when they click on a board, it'll say, "You have to register" or something like that. And I think that's what this topic is about.

So I did everything here and it wouldn't work. Guests can still browse the forums and read topics and posts.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elijah Bliss on January 17, 2005, 08:30:15 PM
Sorry... I think you misunderstood...

What I mean is that a guest can browse the forums. When he/she clicks on a board, he/she can read all the posts, but can't post a reply or make a new topic.

What I was trying to do is to have a guest browse the forums and then when they click on a board, it'll say, "You have to register" or something like that. And I think that's what this topic is about.

So I did everything here and it wouldn't work. Guests can still browse the forums and read topics and posts.

Apply [Unknown]'s modifications to the BoardIndex.php and the MessageIndex.php.
Next go to "Manage Boards" and in the permissions uncheck guest access.

Guest will still be able to see the board but will have no access.

Now as far as guests viewing threads in the message index but not being able read them; I believe I saw a mod for that around here for that, it was a line of code, you'll have to search. I know babylonking has his forum setup like that.
Title: Re: Allowing guests to see all Boards but not entering
Post by: diplomat. on January 17, 2005, 08:44:46 PM
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
Title: Re: Allowing guests to see all Boards but not entering
Post by: ThaJester on January 17, 2005, 09:05:08 PM
The answer to my question may already be here, and I just haven't looked hard enough, however, what was the working way to allow guests and members to see forums that are restricted to them, and not access them?


And to the person that didn't understand why anyone would want to be able to do this, it's simple.

You have the forum "100 Post Club" that only allows a member group that has atleast 100 posts to access it, and you're using this as motivation to keep your members active. Well, this does no good if people with less then 100 posts can't see the forum.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Javis on March 29, 2005, 11:46:49 PM
How would I go about making the same effect for ungrouped members?

I'll explain. I'm using Unknown's code from this thread in my current setup:

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (1, 2, 3)" : '') . ")
This causes it so guests can see only those boards, but when they click on it they get a message that they need access.

So what I need to accomplish is, let's say board ID 4 is a special permission board. It's viewable as a member but you get the same message saying they don't have access. That is until they are added to a group that does.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Hengis on April 16, 2005, 06:47:15 AM
Hi guys,

Great Mod - have applied it to my forum: PC Help Forum.com (http://www.pchelpforum.com/)

One question - when visitors click to go into a topic/board that I have restricted to members they get the "An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you." message and not the "Only registered members are allowed to access this section.
Please login below or register an account with..." message. :(

Is there a way to change this as the "Error" message is a bit - well - non-friendly?


Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on April 16, 2005, 04:49:34 PM
How would I go about making the same effect for ungrouped members?

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (1, 2, 3)" : ' OR b.ID_BOARD IN (4)') . ")
Is there a way to change this as the "Error" message is a bit - well - non-friendly?

Find, Sources/Load.php:
Code: [Select]
fatal_lang_error('topic_gone', false);
Replace:
Code: [Select]
loadLanguage('Errors');
is_not_guest($txt['topic_gone']);

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Hengis on April 16, 2005, 07:22:28 PM
[Unknown] is simply an SMF god!

It works, of course :)

Thank you for your time on this.
Title: Re: Allowing guests to see all Boards but not entering
Post by: SeaOfSin on April 18, 2005, 01:58:48 AM
Not sure if this was answered above but how do you make it possible for guests to see and access all board but one?  I have a forum where there is one board that is hidden from guests, but I want the guest to see the board but not access it!
Title: Re: Allowing guests to see all Boards but not entering
Post by: † ÐëepÇuT¹ † on April 18, 2005, 03:25:15 PM
Not sure if this was answered above but how do you make it possible for guests to see and access all board but one?  I have a forum where there is one board that is hidden from guests, but I want the guest to see the board but not access it!

You could just simply allow that board to be accessible to guests via the Board Manager > Permissions page... (lol)
Title: Re: Allowing guests to see all Boards but not entering
Post by: 3fifty on May 13, 2005, 05:33:17 AM
I got this to work beautifully.  Thank you!  It was just what I was looking for. 

How do I make it so that the login screen shows up instead of this:
Quote
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you. 
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on May 15, 2005, 12:32:02 AM
I posted that somewhere else.  Search for "is_not_guest".

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: BlackMagicWoman on May 28, 2005, 08:55:06 AM
Here is so many try now that i dont know which one work and not work? Can somebody please help me and point out the working modification?

I need users to read forums but as fast they try to read some message they cant do it before registering. Also all interesting subjects are visible but when they try to open it for reading it say something "You have to register first" or something like that  8)

BMW
Title: Re: Allowing guests to see all Boards but not entering
Post by: stargazer_1017 on May 29, 2005, 06:11:26 AM
Thank you very much for this! I was searching for this answer :) The code worked perfectly!

-Shayna
Title: Re: Allowing guests to see all Boards but not entering
Post by: Burpee on June 06, 2005, 06:11:12 AM
Is it possible to allow membergroup -1 (guests) to be able to view the same boards as membergroup 1 (ungrouped), and not the admin/global mod boards like the recycle bin?

I don't really feel it's very effective to have to change the board numbers in the source code each time we mess around with the boards.
Title: Re: Allowing guests to see all Boards but not entering
Post by: ApocryphA on June 24, 2005, 08:03:49 AM
I just did this mod by editing the BoardIndex.php and Load.php.  Everything works well now... guests can now view all the boards, and they must login to enter a board.  But now my Users Online Today mod is not working.  Can anyone help?
Title: Re: Allowing guests to see all Boards but not entering
Post by: ApocryphA on June 25, 2005, 04:31:22 AM
Hmm... anyone?   :-\
Title: Re: Allowing guests to see all Boards but not entering
Post by: SeaOfSin on June 25, 2005, 03:23:38 PM
What happens to the online users today mod? Have you tried reinstalling it?

Sea Of Sin
Title: Re: Allowing guests to see all Boards but not entering
Post by: ApocryphA on June 25, 2005, 10:05:59 PM
This is what I did...

Sources/BoardIndex.php, find:

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

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


Is there a way to change this as the "Error" message is a bit - well - non-friendly?

Find, Sources/Load.php:
Code: [Select]
fatal_lang_error('topic_gone', false);
Replace:
Code: [Select]
loadLanguage('Errors');
is_not_guest($txt['topic_gone']);


The first batch of code is to lock the boards for guest.  The second code is to display the login box.  And now the Users Online Today field on the bottom of the forum is empty.  Did I do something wrong?

No I haven't reinstall the mod.  Will I lose the old records if I reinstall it?

Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on June 26, 2005, 01:20:53 AM
This shouldn't affect that mod in any way.  You may wish to contact the mod's author - in the topic about the mod.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: ApocryphA on June 26, 2005, 07:38:54 AM
Will do.  Thanks!
Title: Re: Allowing guests to see all Boards but not entering
Post by: jazz on June 28, 2005, 03:30:00 PM
This isn't working with 1.0.5.  Is there something else that needs to be modified?
Title: Re: Allowing guests to see all Boards but not entering
Post by: ApocryphA on June 29, 2005, 06:50:24 AM
It's working on mine.  Just modify the quoted code above.

And don't forget the uncheck Guest access on each board.
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on July 27, 2005, 12:40:20 PM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")
Where ##, ##, ## is a list of board IDs.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]

This is what I have been looking for.  I assume, since I want to show just some boards, that all I need to do is use this mod (boardindex change).  When I moded the line though, I got a fatal error further down in the code, in this area:

Quote
// Counting child board posts is... slow :/.
         if (!empty($modSettings['countChildPosts']))
         {
            $this_category[$row_board['ID_PARENT']]['posts'] += $row_board['numPosts'];
            $this_category[$row_board['ID_PARENT']]['topics'] += $row_board['numTopics'];
         }

Here is what I changed:

From:
Quote
WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "

To:
Quote
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (12, 13)" : '') . ") . (empty($modSettings['countChildPosts']) ? "

Also tried to remove . (empty($modSettings['countChildPosts']) ? "  and it gave me a database error.
Title: Re: Allowing guests to see all Boards but not entering
Post by: [Unknown] on July 27, 2005, 10:44:52 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)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on July 28, 2005, 12:22:17 AM
I still get a database error when I add your mod to it.   :'(

edit:
         It works!!  Must have been too sleepy last night to copy and paste it right!!  Thanks [unknown]!!!
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on July 28, 2005, 06:32:24 AM
One other question (sorry).  The mod works great for guests.  Is there any way to make it so that guests and regular members can see but not get into the board?  That way, only members of a specific group will be able to have access to the board.

Edit:  I should clarify this.  Once I did the mod, it worked perfectly.  The only problem is that if a user is registered, they can not see boards 12 and 13 once they log in.  These boards are set up for a specific group only and because you look for guest, they disappear once logged in.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T on August 08, 2005, 08:22:14 PM
I am more confused now than before.

ALot different mods to do different things

What I want is for registered members to be able to see a moderator only thread but not to be able to read or post in it. It should only be visible on the index page.
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on August 08, 2005, 09:46:31 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 put your board number in both spots and you are all set, worked for me.
Title: Re: Allowing guests to see all Boards but not entering
Post by: 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?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Chelle 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
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Dinagyang 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
Title: Re: Allowing guests to see all Boards but not entering
Post by: OlliMuc 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T 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?
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa on August 27, 2005, 07:49:18 AM
I used this code:
 By Forgyx (http://www.simplemachines.org/community/index.php?topic=16281.msg166528#msg166528)
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.....

Title: Re: Allowing guests to see all Boards but not entering
Post by: Carlos Gandra 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!
Title: Re: Allowing guests to see all Boards but not entering
Post by: 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
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa 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)..
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Carlos Gandra 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
Title: Re: Allowing guests to see all Boards but not entering
Post by: Carlos Gandra on August 29, 2005, 11:17:09 PM
Problem solved!

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

Thanks
Title: Re: Guests
Post by: jdougher 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.
Title: Re: Guests
Post by: Elmacik 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa 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..
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elmacik 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
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elmacik 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  ::)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T 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.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elmacik on September 02, 2005, 08:17:45 PM
12,13,27 are board ids right?
so you mean we will change ONLY this code and it will work for all the groups?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T on September 02, 2005, 10:43:06 PM
the 12,13,27 are example board ids. You will need to change those numbers for the boards you want this mod for.

If you will just put in this code and change the permissions for the groups, it work.
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on September 03, 2005, 09:06:54 AM
Hmm...  I started this topic back when I was using RC1. but I cant seem to get it to work with 1.1BP
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elmacik on September 03, 2005, 09:16:43 AM
Hmm...  I started this topic back when I was using RC1. but I cant seem to get it to work with 1.1BP

i made the [unknown]'s code work with 1.1bp but works only for guests.
i will try this now.
edit: this code works ONLY for GUESTS too...
normal members cannot see the marked board. (guest can, but not enter.)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T on September 03, 2005, 01:34:10 PM
For all boards

Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]

For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

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)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

-[Unknown]


And this does work for all guests and groups not assigned to those boards. I am using it on my boards.


Title: Re: Allowing guests to see all Boards but not entering
Post by: Elmacik on September 04, 2005, 05:14:27 PM
i dont know whats wrong but didnt work with my forum.
i changed the codes, changed the board ids accordin to my needs, i removed the permission of the spesific group that i dont want them to enter but to see...
that didnt work..

thanks again. i will try to figure out again.
Title: Re: Guests
Post by: Dinagyang on September 07, 2005, 03:02:00 AM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.



-[Unknown]

I want guests to see the topics posted but not read the message. I need help on this.
THanks!
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on September 07, 2005, 08:21:10 AM
Tried the most recent one you posted by unknown. Its still  not working with 1.1 BP. :-[
Title: Re: Allowing guests to see all Boards but not entering
Post by: edi67 on September 20, 2005, 05:47:00 AM
good trick but is possible do this ?  ???


i want have one section called DONATORS (id=87) that will be visible to 2 or 3 (not important how many groups)  membergroups but allowed to entry are only one membergroups called Donatori (id=134)

how is possible do this?
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on September 20, 2005, 07:56:40 AM
Check [unknown]'s response to my questions earlier in the thread.  The code is there to allow both guests and regular members to see the boards, I currently have it running on my forums.   8)
Title: Re: Allowing guests to see all Boards but not entering
Post by: farg on September 21, 2005, 04:48:38 AM
I think that this all this mods MUST BE include in admin section...
I hope in next release  ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: xtremecruiser on September 23, 2005, 03:01:40 PM
Will this work with SMF 1.1 RC1.
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on September 24, 2005, 04:43:42 PM
That's a question for unknown, but it works with 1.1B3.
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa on September 26, 2005, 09:10:36 AM
I have Unknowns mod running nice on my forum. I created this area for special members that others can see but not come into it.
My older members are asking me to modify it so that this permition can be given manually. Istead of ruling by the amount of posts, it would be authorized by indication.
Any ideas?

Thanks!
:)
Title: Re: Allowing guests to see all Boards but not entering
Post by: flybywire44 on October 19, 2005, 10:34:36 AM
Referencing: http://www.simplemachines.org/community/index.php?topic=16281.msg193474#msg193474

I've tried to apply this code but I cannot figure out which board IDs I should put in there.
Am I doing it right?

I'm using this in the BoardIndex
Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (06, 02)" : '') . ")
This is in regards to the Members Corner and Committie on @ www.alphaomicronalpha.org/forums

Thanks,
-Rick
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on October 24, 2005, 10:43:24 AM
I saw one reply on how to make all the boards visible, but to make the threads unreadable. Can someone please post code on how to make the threads unviewable for only one board?

More explanation: I want guests to be able to view this particular board and to go inside the particular board and see all the different threads in the particular board, but when they click on any of the threads, they will be asked to login/register.

Remember, only one of the boards.

Thanks :)
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on October 25, 2005, 01:36:47 PM
Anyone?
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on October 25, 2005, 01:49:44 PM
I think that is the "normal" operation for SMF.  I mean, without a mod, guests can't post in my forum.  Look in permissions for guests.  Might be way off base, but I bet you can make it so they can't post in the forum.
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on October 25, 2005, 02:41:49 PM
I think that is the "normal" operation for SMF.  I mean, without a mod, guests can't post in my forum.  Look in permissions for guests.  Might be way off base, but I bet you can make it so they can't post in the forum.
I don't think you understood what I meant. I meant that people can't view the threads themselves in a board. If they click on one of the threads in one particular section, they will be taken to the login page.
Title: Re: Allowing guests to see all Boards but not entering
Post by: huijaa on October 25, 2005, 04:44:48 PM
Right...

An example...

If guest see...
+---------
| MemberBoard                 4 topics     By name
| For members only           and           at today, 10:42
| Moderator: name           10 posts
+---------
When that guest clicks into, he gets a login page, but if he was a member, he gets a index of this board. i'm looking for a mod...
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on October 26, 2005, 01:41:22 PM
Can someone give me some code for my problem?

Thanks.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sting on November 04, 2005, 05:14:47 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

has anyone come up with a solution for this? I would like this as well.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jay T on November 08, 2005, 11:01:47 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

has anyone come up with a solution for this? I would like this as well.

I would love to have this mod but not till this can be done.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sting on November 09, 2005, 03:01:05 AM
I'm not even gonna try coding this, but the logistics to it would basically be

check the access of the specific board; if the user does not have access then display Protected Board

and since earlier someone posted a way to pick specific boards to allow guests to view, etc, you could basically do this similarly.
Title: Re: Allowing guests to see all Boards but not entering
Post by: HWB on November 09, 2005, 08:28:18 PM
I have tried each thing that has been listed here and none of it seems to work for me. I want guests to be able to view forums on the board but not be able to read them. If they click on the board, I would like it to tell them they must register to view. Can someone please help me.
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on November 10, 2005, 10:44:27 PM
Quote
I saw one reply on how to make all the boards visible, but to make the threads unreadable. Can someone please post code on how to make the threads unviewable for only one board?

More explanation: I want guests to be able to view this particular board and to go inside the particular board and see all the different threads in the particular board, but when they click on any of the threads, they will be asked to login/register.
how do i do this?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sting on November 11, 2005, 03:24:32 AM
Quote
I saw one reply on how to make all the boards visible, but to make the threads unreadable. Can someone please post code on how to make the threads unviewable for only one board?

More explanation: I want guests to be able to view this particular board and to go inside the particular board and see all the different threads in the particular board, but when they click on any of the threads, they will be asked to login/register.
how do i do this?

Ok, the below was posted in an earlier reply and seems to explain it the best



For all boards


For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

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)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

-[Unknown]


And this does work for all guests and groups not assigned to those boards. I am using it on my boards.



Title: Re: Allowing guests to see all Boards but not entering
Post by: genois on November 12, 2005, 12:51:57 AM
could there be additional code so that
there is a permission set in the admin panel...

like the board is viewable to who.. (eg: all, member, specfic group)
so that i wont have to change the codes again and again
when i have more boards added... or when i have more groups..
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on November 13, 2005, 06:53:43 PM
Sting, I just tried it, and it doesn't seem to have any affect at all. Guests can still go into those boards. I also tried the code to make it for every board, but still no effect. Guests still have all access to all threads.

-Freak
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sting on November 13, 2005, 09:32:11 PM
Have you gone into the permissions and set it so guests can't see boards there? With this + the code shown previously, guests will see the board but won't be able to enter them.
Title: Re: Allowing guests to see all Boards but not entering
Post by: thetzfreak on November 13, 2005, 09:53:38 PM
Alright I did that... but now when I click on the board, it's asking me to login :(
Title: Re: Allowing guests to see all Boards but not entering
Post by: bloc on November 14, 2005, 12:34:20 PM
If you rather not do this hack in source files, try this idea:

http://www.simplemachines.org/community/index.php?topic=55739.msg390801#msg390801

Beware that this apply to boards that all can see..which you rather restrict threads to non-guests. So don't set permissions on it, allow all access. Think of it as a extra roadblock before the entrance... ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Carlos Gandra on November 29, 2005, 03:46:56 PM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")
Where ##, ##, ## is a list of board IDs.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]

Today I've found a problem with this code. The private boards (wich ID we don't put on that code and ungrouped members aren't allowed to access), still invisible but... with the link of this private board, anyone registed member could enter and read :-X

One of my ungrouped members have put the link of the private board on the browser and he could access him without appear the message "board doesn't exist". He couldn't reply, but could read...

Do you have a solution or the best to protect private boards is remove this code :'(?

Thanks in advance

Title: Re: Allowing guests to see all Boards but not entering
Post by: Sheepy on November 29, 2005, 10:29:27 PM
I'm doing a 'see but don't read' mod controlled by group permission.  Sorry my flu is delaying the progress.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sheepy on November 30, 2005, 04:26:02 AM
It's done.  http://mods.simplemachines.org/index.php?mod=231
It won't stop guests from seeing what topics are there, but it will prevents them from actually reading the topics, if you deny them the permission.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Saku on December 05, 2005, 06:37:04 PM
in BoardIndex.php
i changed
WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
         AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

with

WHERE  b.childLevel <= 1", __FILE__, __LINE__);

and i'm using SMF 1.1RC1
Title: Re: Allowing guests to see all Boards but not entering
Post by: sadiqbaig on December 12, 2005, 09:23:36 AM

no its not showing ne error ,
also allowing guests to view board

can sum1 tell me how to do this for  SMF 1.1 RC1
Title: Re: Allowing guests to see all Boards but not entering
Post by: MacGig on January 06, 2006, 08:50:26 AM
didnt work for me either. :(
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on January 11, 2006, 11:59:57 AM
Can we have this for RC2 please?
Title: Re: Allowing guests to see all Boards but not entering
Post by: CountryLady on January 14, 2006, 01:38:02 AM
Sure would love to have this for 1.1 Gold...pretty please...?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Avinash4 on January 25, 2006, 12:15:56 AM
Yeah, we really need this in 1.1. This method wont work for my RC2.
Title: Re: Allowing guests to see all Boards but not entering
Post by: definitive on February 12, 2006, 11:29:21 AM
Hello is it possible to allow guests to see the first 250 chars of the topics and then a message "You must register to read the rest" ?

I am using 1.1 RC2

Thanks
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on February 12, 2006, 01:20:24 PM
Yeah, we really need this in 1.1. This method wont work for my RC2.

I have RC2 and it worked perfect.

Make sure you have 'Aloow guests to browse the boards' in features and options ticked
Title: Re: Allowing guests to see all Boards but not entering
Post by: fiver on February 13, 2006, 12:32:07 AM
Hello is it possible to allow guests to see the first 250 chars of the topics and then a message "You must register to read the rest" ?

I am using 1.1 RC2

Thanks

You can combine Read Topic Permission (http://mods.simplemachines.org/index.php?mod=231) with MessagePreview Inline (http://mods.simplemachines.org/index.php?mod=262).

Demo: http://www.fivearts.net/rc2/index.php?board=1.0
Title: Re: Allowing guests to see all Boards but not entering
Post by: definitive on February 13, 2006, 09:33:02 AM
Hello is it possible to allow guests to see the first 250 chars of the topics and then a message "You must register to read the rest" ?

I am using 1.1 RC2

Thanks

You can combine Read Topic Permission (http://mods.simplemachines.org/index.php?mod=231) with MessagePreview Inline (http://mods.simplemachines.org/index.php?mod=262).

Demo: http://www.fivearts.net/rc2/index.php?board=1.0

thanks, but this work when guest enters a board, no way when he enters a topic
Title: Re: Allowing guests to see all Boards but not entering
Post by: md80forum on February 13, 2006, 05:43:01 PM
Got my package manager screaming when I tried to install the Read Topic Permission mod ...

Jan-Erik
Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on February 21, 2006, 04:03:25 PM
Now that I understand how to allow visitors to see boards without accessing

how would I set up just one board or category to remain hidden until user logs in ?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Dinagyang on February 23, 2006, 05:46:17 AM
what about to limit guest access by time or page views?
Title: Re: Allowing guests to see all Boards but not entering
Post by: ~dragonfly~ on February 26, 2006, 01:23:56 AM
I've tried this mod and I'm getting an error.  I'm new to this and have read through this entire thread, but I'm not sure if I did it wrong, or there is another issue.  I'm using 1.1 RC2

In Sources/BoardIndex, I replaced

Quote
WHERE $user_info[query_see_board]

with

Quote
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (2, 3, 4, 5, 6, 7, 8, 14, 15)" : '') . ") .

That is on line 82.

The error message I get is

Quote
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Sources/BoardIndex.php on line 82

I also unchecked guest permission in each of the boards.  Any thoughts would be appreciated  :)
Title: Re: Allowing guests to see all Boards but not entering
Post by: ~dragonfly~ on March 04, 2006, 11:26:38 PM
I read through the more recent posts in the thread and figured it out the one minor change I needed to make.  Its working for me now using RC2.   :)



Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on March 05, 2006, 11:26:06 AM
There was a post from unknown, in response to me, pretty early on in the thread.  I put that code in, RC2 even, and I have no problems and the mod works great.

Here is the only change I made, in BoardIndex.php

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 put your board number in both spots and you are all set, worked for me.

(This was from post 58)
Title: Re: Allowing guests to see all Boards but not entering
Post by: BigPapaPorsche on March 08, 2006, 07:24:39 AM
Thanks to whoever started this thread and all who contributed within.  I need a little bit of help to complete this mod on my forums.  I am currently running 1.1rc2.  I have edited the Sources/Boardindex.php file with the suggested code.

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (1, 2, 3, 6, 7, 8)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
                        AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

After I did this smf shows all of the board id's specified within the WHERE statement to guests.  When they click on the link to see the topics within the board they are prompted for their username and password.  I would like them to be able to see the topic titles and promted for username and password when they click the link to enter a specific topic.  In other words I do not want guests to see the actual content of the site.  I know Uknown mentioned something about editing Sources/Messageindex.php but I was hoping someone could clarify this for me.  The string he suggested that needed editing has two appearences within the file.


I believe this is what Uknown suggested to be edited


1st apearence
Code: [Select]
// Load up the child boards.
                $result = db_query("
                        SELECT
                                b.ID_BOARD, b.ID_PARENT, b.name, b.description, b.numTopics, b.numPosts,
                                m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
                                IFNULL(mem.realName, m.posterName) AS realName, ID_PARENT,
                                " . ($user_info['is_guest'] ? '1' : '(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED)') . " AS isRead,
                                IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER
                        FROM {$db_prefix}boards AS b
                                LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
                                LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
                                LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
                        WHERE " . (empty($modSettings['countChildPosts']) ? "b.ID_PARENT IN (" . implode(',', $theboards) . ")" : "childLevel > 0") . "
                                [color=red]AND $user_info[query_see_board]", __FILE__, __LINE__);[/color]
                $parent_map = array();
                while ($row = mysql_fetch_assoc($result))


2nd apearence
Code: [Select]
// Aren't children wonderful things?
        $result = db_query("
                SELECT
                        b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
                        m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
                        IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
                        (IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead," : "1 AS isRead,") . "
                        IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
                        mem2.realName AS modRealName
                FROM {$db_prefix}boards AS b
                        LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
                        LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
                        LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
                        LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
                        LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
                WHERE b.ID_PARENT = $board
                        [color=red]AND $user_info[query_see_board]", __FILE__, __LINE__);[/color]
        if (mysql_num_rows($result) != 0)


I am not exactly sure of the code I should be editing them with or if either or both statments should be edited.  Can someone please clarify for me?

Thanks,
David
Title: Re: Allowing guests to see all Boards but not entering
Post by: Avinash4 on March 11, 2006, 01:33:13 AM
I read through the more recent posts in the thread and figured it out the one minor change I needed to make.  Its working for me now using RC2.   :)





care to share?
Title: Re: Allowing guests to see all Boards but not entering
Post by: jfertic on March 11, 2006, 07:42:20 PM
Well I have read this thread for hours now and can not seem to make it work. I have tried all three versions of the hack and it will not work as described. I am running RC2 with MK RC1. Maybe that has something to do with it.

The best it did for me was make the board not viewable by guests. I ticked the boxes, and unticked the boxes. Still nothing.

Is there a set way that this works. I see three different ways to change the code for this hack and none seen to work for me? And...has this been packaged as a mod?

jfertic
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on March 13, 2006, 06:49:34 AM
If you used the hack I posted a few posts up, then all you have to do is just make it so that the guests don't have access to the board (uncheck the guests on the board access list, that's it).  Then, using the hack, the board shows up on the index. 
Title: Re: Allowing guests to see all Boards but not entering
Post by: jfertic on March 13, 2006, 11:46:20 AM
Thanks for the reply. That was the code I modified in boardindex.php. When I unchecked the box for guest access, the board disappeared when viewing the site as a guest. I even tried clearing the cache but was the same.. I will try it again today and see if I somehow got something wrong.

Thanks Again!

jfertic
Title: Re: Allowing guests to see all Boards but not entering
Post by: jfertic on March 13, 2006, 12:22:06 PM
Ok, I have tried the code you mentioned in your post. Cut an paste it properly into boardindex.php, and unchecked the access for that particular board. I logged out of admin to guest, and the boards are not visable anymore. This is the same thing that happened the last time.

My best guess is that it might be one of my mods creating the problem. Any ideas? I will g=be glad to listen. I would really like to use this hack on my site.

jfertic
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on March 13, 2006, 02:28:22 PM
Did you make sure you listed the boards you wanted to be visible in both areas of the hack?  That's all I can figure that would be wrong. 
Title: Re: Allowing guests to see all Boards but not entering
Post by: jfertic on March 13, 2006, 03:28:05 PM
I did list in both sides of the code. The only thing I can think of is trying to turn off "allow guests to browse forums" in the admin panel.

When I turn off individual boards, they disappear from the forum index. The only other thing that I can think is one of the mods is blocking the hack from working correctly. At least two of them I know for sure modify the boardindex.php file as well as the SSI.php file.

Well, thanks again for the advice! I will keep messing with it.

jfertic
Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on March 27, 2006, 11:49:38 AM
There was a post from unknown, in response to me, pretty early on in the thread.  I put that code in, RC2 even, and I have no problems and the mod works great.

Here is the only change I made, in BoardIndex.php

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 put your board number in both spots and you are all set, worked for me.

(This was from post 58)

curious, does this apply to childboards as well ? i tried it and it shows the childboard, is there anyway to also restrict certain childboards as well ?
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on March 29, 2006, 12:27:53 PM
I can't remember what unknown told me.  One of those groups is to show child boards I think, maybe the second list of boards?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Cottelletje on April 05, 2006, 10:10:53 AM
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 FIND_IN_SET('0', b.memberGroups)" : '') . ")


--> Tips and Tricks.

i did this but it doesn't work PS i use an other theme(saf)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Captain_Morrigan on May 10, 2006, 06:08:37 PM
If you have a lot of protected boards you want to show and you do not want to show ALL of them, boards like admin or moderator boards, and the admin/moderator boards do not outweigh your amount that you want to show then you can do the following.


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


Replace with:

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

This will make all boards except 2, 10 and 27 visible to everyone except to those who have access.
Title: Re: Allowing guests to see all Boards but not entering
Post by: meadwench on May 23, 2006, 01:39:39 AM
Huh. I made the hacks above, put in my board numbers, and set those boards as *unchecked* in 'access' under permissions to all but the specific group that should be able to see the posts in those boards.

What *happens* is that it works great for guests, but logged in registered users (who should see the same thing as guests) see *only* the boards I'm trying to restrict, and not all the open boards.

Ideas?
Title: Re: Allowing guests to see all Boards but not entering
Post by: meadwench on May 23, 2006, 10:03:47 AM
Odd. It didn't work as I thought (see above). So, I put it back to the way it was (restored BoardIndex.php to its original form using a backup), and my users can't see any boards at all now. This is *very* strange. Guests can see all the open boards, but registered users can't see *any* boards!

Help?!!
Title: Re: Allowing guests to see all Boards but not entering
Post by: meadwench on May 23, 2006, 11:27:26 AM
OK. Must have been cookies or something, its showing now.........

I'm still hoping I can get this technique to work...I'd like to dangle the 'special' forums in front of all groups, but only let the paid group read and post in the special boards..

Any advice?
Title: Re: Allowing guests to see all Boards but not entering
Post by: fiver on May 23, 2006, 12:20:20 PM
Hi meadwench,

I have great pleasure using the following two mods. Together, they give an admin full control through permissions.

Hide Board (http://mods.simplemachines.org/index.php?mod=236)
If user doesn't have this permission, he can not enter the board that he can see.

Read Topic Permission (http://mods.simplemachines.org/index.php?mod=231)
Check out my website's Notice Board (http://www.fivearts.net/index.php/board,2.0.html). Guest can see the topic titles but cannot read the Normal topics, but I have also set it so that Guest can read Sticky topics.

 :)




Title: Re: Allowing guests to see all Boards but not entering
Post by: Farmacija on June 02, 2006, 06:16:04 AM
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]

it doesnt work. Guest still can see and read the topics
Title: Re: Allowing guests to see all Boards but not entering
Post by: CLICKBANKS.NET on June 07, 2006, 04:58:06 PM
Just wondering if i use this tricks allowing guest to see all boards but not entering so can the search engine(google,yahoo,msn, etc) still can spider the rest of the boards?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Farmacija on June 08, 2006, 04:51:19 AM
Bravo aku u just wanted to ask the same question
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on June 08, 2006, 02:06:45 PM
Well if the search engine cannot view your topics because they are guests then I'm guessing they can't.
Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on June 17, 2006, 11:55:37 AM
Is there a way to add "guest can see all boards but not enter" inside the admin ?

I understand there's a hack for this but anyway to add a turn on / turn off feature on the admin for this ?

Its shocking that SMF doesn't come with this basic feature

there is one method in SMF where you can allow guest to see a board and they can enter the board and see all topics but when they try to open one they are not allowed to enter,

I can not see much use for that setup why not just have it so they can see the board but can not enter it period..

I think the SMF permissions needs a few more very basic ones added to it in order to really customize
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on June 22, 2006, 02:39:09 AM
wow, i started this thread almost two years ago! lol.  This post worked for me. I just recently upgraded my forums from 1.07 to 1.1rc2.

Code: [Select]
For all boards


For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

Quote from: [Unknown] on July 27, 2005, 10:44:52 PM
You want to replace this:

Code:

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


With:

Code:

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


Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on June 23, 2006, 09:14:30 PM
Is there a way to restrict access to recent topics that are enabled in admin ?

would like guest not to be able to see it
Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on June 24, 2006, 02:20:08 PM
what file is that in, I haven't found that code in any of the files
Title: Re: Allowing guests to see all Boards but not entering
Post by: Vinspire on June 26, 2006, 12:36:49 PM
I want guests to be able to see all the boards, but when the click the board, its says they have no access to it without login. How do I do this. WHen i set permissons in the admin, when your a guest the board just doesnt appear at all to them.   I want it to be able to be seen, but disable access until they are registered.  not sure if this makes sense.

[edit] changed topic title [/edit]

Whats the edit code for SMF 1.1 RC 2 ? I followed the code in page 1 but it didnt work.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Vinspire on July 08, 2006, 05:40:16 AM
Where is the working code for SMF 1.1 RC 2 ?  :'(
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on July 10, 2006, 07:30:18 AM
THIS WORKED FOR ME IN 1.1RC2.  Check my sig to view my sites. Im using it in BOTH!.

what file is that in, I haven't found that code in any of the files

Sources/BoardIndex.php, find:

Code: [Select]

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

For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

Change the above code to this:

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

Be sure to change those BOARD ID numbers to what you want GUESTs to VIEW but not access.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Mayhem30 on July 11, 2006, 05:36:06 PM
Just so I got this right ..

If I change the #'s to 1 & 2, guests can see the boards 1 & 2 but when they try and access the section, it'll prompt them to register?

Will guests still be able to access my other sections (3-5) and read everything just fine?
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on July 12, 2006, 05:18:46 AM
yes.^  I think you also need to unmark access for guests in the BOARD section via the admin of your forum.
Title: Re: Allowing guests to see all Boards but not entering
Post by: dairin on July 13, 2006, 08:48:16 PM
so for SMF 1.0.7, which code is working ??
any1 care to share ??
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on July 14, 2006, 11:34:27 AM
Ban is just another word for deactivate anyway
Title: Re: Allowing guests to see all Boards but not entering
Post by: Alan S on July 16, 2006, 08:25:51 AM
THIS WORKED FOR ME IN 1.1RC2.  Check my sig to view my sites. Im using it in BOTH!.

what file is that in, I haven't found that code in any of the files
   


Sources/BoardIndex.php, find:

Code: [Select]



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

For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

Change the above code to this:

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

Be sure to change those BOARD ID numbers to what you want GUESTs to VIEW but not access.

that code didnt work for me , i entered the id's off all my boards except 1 and then i logged out and tryed it and i could access every board on the forum


Edit - Never Mind Figured It Out
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on July 19, 2006, 07:50:15 AM
Hey trenchteam, got a quick question for you.  Obviously, the code has been working for me since I first implemented it waaaaaaay back.  I changed my forum though, today, to move two of the boards I have this mod in for, to a child board.  They shows up on the main index as child boards, but when I go into the parent board, they disappear.  I thought that the second place that you enter the board numbers made it appear when if they are a child board?

If my explanation is fuzzy, you can check out http://northeastatvers.com/forum/index.php

Look for the Media Studio board, you'll see pictures and videos child boards.  Click on Media Studio and those boards disappear.
Title: Re: Allowing guests to see all Boards but not entering
Post by: bugsmi0 on July 21, 2006, 04:09:46 AM
is the Registered Links Mod an alternative to some of the hacks mentioned here ?

this mod is suppose to not let guest view any links, wonder if it can be used instead of the hacks
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on July 21, 2006, 05:34:18 AM
Hey trenchteam, got a quick question for you.  Obviously, the code has been working for me since I first implemented it waaaaaaay back.  I changed my forum though, today, to move two of the boards I have this mod in for, to a child board.  They shows up on the main index as child boards, but when I go into the parent board, they disappear.  I thought that the second place that you enter the board numbers made it appear when if they are a child board?

If my explanation is fuzzy, you can check out http://northeastatvers.com/forum/index.php

Look for the Media Studio board, you'll see pictures and videos child boards.  Click on Media Studio and those boards disappear.

I see it fine.
Title: Re: Allowing guests to see all Boards but not entering
Post by: trenchteam on July 21, 2006, 05:36:35 AM
is the Registered Links Mod an alternative to some of the hacks mentioned here ?

this mod is suppose to not let guest view any links, wonder if it can be used instead of the hacks

This allows Guests to view boards descriptions even though you set the board not to allow Guests to view posts.  When guests attempt to access the posts, they are redirected and told to register.
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on July 21, 2006, 07:34:52 AM
Hey trenchteam, got a quick question for you.  Obviously, the code has been working for me since I first implemented it waaaaaaay back.  I changed my forum though, today, to move two of the boards I have this mod in for, to a child board.  They shows up on the main index as child boards, but when I go into the parent board, they disappear.  I thought that the second place that you enter the board numbers made it appear when if they are a child board?

If my explanation is fuzzy, you can check out http://northeastatvers.com/forum/index.php

Look for the Media Studio board, you'll see pictures and videos child boards.  Click on Media Studio and those boards disappear.

I see it fine.

Really?  After you click on the Media Studio board, you should see the pictures and videos child boards at the top of the thread listings, and I can't see them.....  Check out the snapshot below, see, no child boards.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fnortheastatvers.com%2Fuploads%2Fguest_view.jpg&hash=8e9939a373785fe018d7f7f082769c3a)

I assume in the code snippet below, that the problem has to do with the b.childLevel arguement?  Can I just make that 2 and the boards will show up?

Quote from: Code
      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_');
Title: Re: Allowing guests to see all Boards but not entering
Post by: genois on July 21, 2006, 09:12:26 AM
For all boards

Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]

For specific boards. You have to change the (12, 13) to the specific boards on your forums you want this to work on. (12, 13) are just an example

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)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

-[Unknown]


And this does work for all guests and groups not assigned to those boards. I am using it on my boards.





it works for RC2
Title: Re: Guests
Post by: maritimesbob on July 22, 2006, 10:35:04 PM
Sources/BoardIndex.php, find:

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

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

-[Unknown]

This is just what I needed for my SMF 1.1 RC2 board. One slight problem is, while guests can see all the forums now the forums they are permitted to see they can also reply to topics in them. That despite not having permission to do so in the guests permission settings. So basically, I have now have to deny guests access to all my forums.

What I was hoping to achieve, was so guests could access certain forums but denied access for others and of course, I don`t want guests having reply permissions.
Title: Re: Allowing guests to see all Boards but not entering
Post by: meadwench on August 04, 2006, 12:47:59 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)" : '') .')' . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

-[Unknown]


This sounds great, but how would you make this work for both guests *and* registered? I have a special group called 'patrons' that can see 3 boards that no one else can see. I'd like guests *and* registered to be able to see the board and topics, but not the posts.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jennifer on August 24, 2006, 05:39:15 AM
Quote from: Alan S link=topic=16281.msg646512#msg646512
Edit - Never Mind Figured It Out

How? It's not working on mine; I'm running 1.3
Title: Re: Allowing guests to see all Boards but not entering
Post by: meadwench on September 15, 2006, 08:17:13 PM
Yeah, I had it working on RC2, but when I upgraded to RC3, it stopped working. Has anyone worked out the new code for RC3 yet?
Title: Re: Allowing guests to see all Boards but not entering
Post by: bollywhat on September 21, 2006, 03:15:02 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 put your board number in both spots and you are all set, worked for me.

(This was from post 58)


I've got a question.  I don't have

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

in my boardindex.php!  I only have this:

Code: [Select]
WHERE $user_info[query_see_board]
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1

So what should I change?
Title: Re: Allowing guests to see all Boards but not entering
Post by: landshark on September 25, 2006, 02:21:14 PM
I'd also like to know if this hack is working in RC3? Has anyon been able to get it to work?
Title: Re: Allowing guests to see all Boards but not entering
Post by: landshark on September 28, 2006, 11:33:39 AM
Ok i am going to take the lack of response as a No it isn't working in RC3 yet. Is there anyone working on getting it to work?
Title: Re: Allowing guests to see all Boards but not entering
Post by: codenaught on October 01, 2006, 10:48:36 AM
bollywhat, I'm not sure why your code looks like that. Are you using RC3 with any mods?

If you can tell me what you want to do, I can try to help you. That code you pointed to appeared to make it so that guests would see certain boards they could did not have access to on the board index. But the code seemed to make it so that any member would see it on the board index, not just guests.

ladyshark, have you even tried this? http://www.simplemachines.org/community/index.php?topic=16281.msg315008#msg315008

That should work on RC3.
Yeah, I had it working on RC2, but when I upgraded to RC3, it stopped working. Has anyone worked out the new code for RC3 yet?
This code is still in RC3: http://www.simplemachines.org/community/index.php?topic=16281.msg315008#msg315008

Title: Re: Allowing guests to see all Boards but not entering
Post by: landshark on October 03, 2006, 09:47:08 PM
You know what they say when one "assumes", I just figured since someone said it wasn't working that it wasn't. I made the change as described and all seems to be working as i want.

thanks for the kick in the butt akabugeyes
Title: Re: Allowing guests to see all Boards but not entering
Post by: d3v1an7 on October 23, 2006, 03:30:05 AM
Hey guys,

Thx for the information so far - been very helpful...

I'm using the hack, which is working great - but I can't for the life of me seem to remove the 'Last Post' information on the board index.
There was talk of this earlier in the thread, but it was only just mentioned... Is there any working hack that will remove the last post info if they do not have access to the boards?

I'm just trying to get the forums like they were in phpBB - in every other case, they are much better, but this issue has been evading me all day.

Any info would be appreciated - Thanks!
Title: Re: Allowing guests to see all Boards but not entering
Post by: 5h4rk on October 24, 2006, 06:45:30 AM
This sounds great, but how would you make this work for both guests *and* registered? I have a special group called 'patrons' that can see 3 boards that no one else can see. I'd like guests *and* registered to be able to see the board and topics, but not the posts.

I want to do exactly the same thing! becasue I got a board that only Mod and Admin has access, and I want it to be viewed by Guest and Registered, but so far, guest can see all boards, and registered all boards except the one that I mentioned.

I'm working with RC3.
Title: Re: Guests
Post by: teamvtec on October 31, 2006, 12:54:32 PM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]

I want a certain member group to have the same access as guests for some boards, so that they can see the board but do not have access, can i change the:
" OR FIND_IN_SET('0', b.memberGroups)" to " OR FIND_IN_SET('4', b.memberGroups)" ??
Or does it work that way?


Title: Re: Allowing guests to see all Boards but not entering
Post by: dmw3913 on November 01, 2006, 05:49:32 PM
Looking for the mod that ables guests to view a topic but not able to read the posts inside it.
I have SMF Version 1.0.9 (just updated) and I am not sure which if any of the mods in this post work with this version.  Does anyone have it working for this version?? Much Appreciated.
Title: Re: Allowing guests to see all Boards but not entering
Post by: digikleuter on November 04, 2006, 10:47:05 AM
whow... this is a difficult board to read. I searched a bit but didn't exactly found what I was looking for.

I want: not registert guests to see the forum, boards AND topics, but they must not be able to enter the topics. Is this possible with permissions or do I need to mod something? I have no skills in code, so i'll need some help...

Thanks,
Mario
Title: Re: Allowing guests to see all Boards but not entering
Post by: Vinspire on November 04, 2006, 10:44:22 PM
Will this prevent spiders from checking out my forum too ?
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on November 06, 2006, 06:50:10 AM
I would have to say yes, I haven't seen a spider in the boards that I have applied this mod to.
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on November 06, 2006, 11:55:09 AM
BTW, just installed this with 1.1RC3 with no problems!
Title: Re: Allowing guests to see all Boards but not entering
Post by: rockgeek on November 11, 2006, 07:09:10 AM

Please can someone help me out - I believe this would be the final piece to my jigsaw of integrating SMF with Wordpress!
Title: Re: Guests
Post by: Alice on December 01, 2006, 06:18:20 PM
For anyone that wants to make boards visible to guests, but when a guest clicks to view the board they are told they don't have permission (must be registered) use this code given by [Unknown].  Worked with my 1.0.8.

Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (##, ##, ##)" : '') . ")
Where ##, ##, ## is a list of board IDs.

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 02:49:19 PM
Wow, I read through every post in this topic.  :D

I'd like to be able to give a post group this permission, instead of guests.

So for example:
User A can see board A. He tries to access it, but he can't.
User earns 10 posts. He can now not only see it, but he can access it.

Any help guys?

PS: It'd be great if Post groups had the same permission options as normal groups. It really sucks because of the lack of that feature.
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 02:55:33 PM
Mod: Read topic Permissions

That will do what you are looking for ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 03:04:32 PM
You sure? I've already got this on there, but I cannot use it to set Post group permissions. If there's a way of setting local post group permissions that'd be great. :)
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 03:07:17 PM
So for example:
User A can see board A. He tries to access it, but he can't.
User earns 10 posts. He can now not only see it, but he can access it.

Any help guys?

PS: It'd be great if Post groups had the same permission options as normal groups. It really sucks because of the lack of that feature.

User A can see board A but not enter. That will happen with a membergroup you choose if you use the read topic permissions mod.

User earns 10 posts and can now see. With the Read topic permission mod disabled, a standard post group will work for this.

Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 03:09:07 PM
lol but how?  ;D

I appreciate your time btw ;)

edit: I mean, how do I disable the mod for a post count group?
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 03:20:51 PM
Admin > Permissions > Post Group A > Allow read topic? Off. (or something close to looking like that)

Same thing, but: Post Group B > Allow read topic? On.

Obviously it won't be "Allow read topic", it's been a while since I saw it.
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 03:23:30 PM
Admin > Permissions > Post Group A > Allow read topic? Off. (or something close to looking like that)

Same thing, but: Post Group B > Allow read topic? On.

Obviously it won't be "Allow read topic", it's been a while since I saw it.
Nope, see, this is my problem.
Post groups aren't included in the permissions.  :(
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 03:24:14 PM
You can modify permissions for post groups per-board.

So Board A you don't want Group A to see posts, you'd modify their permissions and untick Allow view topics.
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 03:31:29 PM
You can modify permissions for post groups per-board.

So Board A you don't want Group A to see posts, you'd modify their permissions and untick Allow view topics.
I'm using 1.1RC3 and I don't see any of the post groups there.  :o
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 04:06:23 PM
Admin > Permissions > Settings > Enable permissions for post count based groups TICK

Admin > Permissions > Settings > Enable advanced by-board permissions TICK
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 04:16:46 PM
Admin > Permissions > Settings > Enable permissions for post count based groups TICK

Admin > Permissions > Settings > Enable advanced by-board permissions TICK

Thanks. Had the second one ticked already, but not the first.

THANKS AGAIN!!  8)
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 04:24:05 PM
No problem.. lol I helped someone for once ;D
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 15, 2006, 04:33:32 PM
No problem.. lol I helped someone for once ;D
lol Yeah. Why can't those options automatically be set on as default.  :P Makes life hard on the noobs, me, myself and I. ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 15, 2006, 04:35:29 PM
Just depends on how the creators set it really :P
Title: Re: Allowing guests to see all Boards but not entering
Post by: CyberPhreak on December 15, 2006, 11:11:25 PM
Can anyone just find out a way to do this for SMF 1.1?
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 16, 2006, 01:29:08 AM
Sorry, but I tried what I was told and it didn't work.

I really, really thought it would. I'm thinking I'm so tired I'm confused. If you could tell me which permissions to set that'd be great. :)

As in Post count groups below the post count have these settings: blah blah
Post count groups with the required post count and above have these settings: blah blah

Sorry guys  :-[
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on December 18, 2006, 10:07:12 AM
Can anyone just find out a way to do this for SMF 1.1?

I have a mod for this, working for any version of SMF.
More flexible, you can choose which groups can see which boards.
I'm not sure if I ever released that mod, I'll have to check it out.
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 18, 2006, 11:05:58 AM
Aw man would be cool if ya could!
Title: Re: Allowing guests to see all Boards but not entering
Post by: twostars on December 20, 2006, 07:53:36 AM
Can anyone just find out a way to do this for SMF 1.1?

I have a mod for this, working for any version of SMF.
More flexible, you can choose which groups can see which boards.
I'm not sure if I ever released that mod, I'll have to check it out.
Sounds great, but does it control who can see and who can access... because I want a membergroup to be able to see the board, but not be able to get inside it.
They need a required post count to get inside ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on December 20, 2006, 07:58:02 AM
You can set who can see on the board index and who can actually access the content of the board.
PS. here's a screenshot
This is the board settings. I added a second column of checkboxes, where the second one is the "visibility" box. The first one is the normal access. As you can see in this example, the "Guests" (Visitatori) can see the board, but can't access it. The second checkbox is optional, meaning that if a user has access to a board it will be always visible even if you don't check the 2nd box (ex: Art Director).
Hope this illustrates better the idea.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fdigilander.libero.it%2Frudoka%2Fsmfmods%2Fboardindex.png&hash=1a9bd43f26ba78f100a5c37072bddcc4)
Title: Re: Allowing guests to see all Boards but not entering
Post by: L.G.S on December 20, 2006, 08:19:52 AM
Sweet, any release date soon?
Title: Re: Allowing guests to see all Boards but not entering
Post by: haxen on December 31, 2006, 06:39:01 PM
I applied unknown's mod from page 1 of this thread on my site http://www.ps3hax.com (http://www.ps3hax.com) for a SMF 1.1.1 site, and now guests can see the Forum index of boards, but not enter the ones where I have taken Guest permission off in Board settings.  Nice.

Would love to have guests  (and Googlebot) be able to see Forum index and to see Topics inside a board, but not to see the individual posts inside a topic for a chosen board.  That would give googlebot and guests a lot to see, without the total info.

Rudolf, let us know when we can test your mod, looks impressive (need english controls please).

cheers everyone.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on December 31, 2006, 07:00:05 PM
maybe tonight... ???
I'm finishing up another mod, then turn to this
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 02, 2007, 08:21:20 PM
Edit: mod info removed, see this post (http://www.simplemachines.org/community/index.php?topic=16281.msg891361#msg891361) later in this topic for the mod info
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 04, 2007, 12:44:37 AM
How do I allow guests to view the threads in the message index but not be able to read them without registering? All I want them to see is the subject. Been searching for the answer for almost an hour and I give up so I'll just ask.
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 04, 2007, 01:01:28 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=605)
Alternative Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/cbiview/Custom_BoardIndex_View_1.0.zip)
Have fun.

The readme file doesnt state how to use it. I'm sure its a great mod but I have no idea how to configure it.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 04, 2007, 02:58:17 AM
How do I allow guests to view the threads in the message index but not be able to read them without registering? All I want them to see is the subject. Been searching for the answer for almost an hour and I give up so I'll just ask.
That feature is not implemented, and it wasn't supposed to, but I added to the mod. I'll update the package in a day or two, and release it.

And I'll review the readme file. I don't remember what I wrote and what not. I'm talking about the readme.html in the package.
Title: Re: Allowing guests to see all Boards but not entering
Post by: teamvtec on January 04, 2007, 09:17:35 AM
I have a question, i installed the mod and now i want to deny some board rights to my "Trail member" group and "Rookie" group, i want them to see the boards but not entering.

But when i set the permissions for a board and then try it with a test account i can still enter the boards ::)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg219.imageshack.us%2Fimg219%2F3771%2Fimg2vk9.jpg&hash=1f19d996c48e203d90c46b2aed878e8f)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg216.imageshack.us%2Fimg216%2F4867%2Fimg1pw6.jpg&hash=ef6799989e7809eb998d814e6fe6fd07)

Why is this happening?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 04, 2007, 09:40:33 AM
Because The trial member is also a Regular member.
So it has access.
The access and visibility is the "sum" of all the gruops the member is member of.
Title: Re: Allowing guests to see all Boards but not entering
Post by: teamvtec on January 04, 2007, 10:56:05 AM
Got it to work, i set the regular members to "see" board but no access then also set the "Trail member" to "see" board but no access ;D

Thanks for this mod.
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 04, 2007, 11:00:18 AM
How do you get to these settings with this mod?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg219.imageshack.us%2Fimg219%2F3771%2Fimg2vk9.jpg&hash=1f19d996c48e203d90c46b2aed878e8f)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 04, 2007, 11:04:57 AM
Try disallowing regular members.
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 04, 2007, 11:14:13 AM
Ok I figured out how to get to those settings but maybe this mod doesn't do what I need it to do?

What I want is for Guests to be able to view a forum but not the threads inside it. All I want guests to be able to see is the title of the threads. Is this possible?

Thanks much!
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 04, 2007, 11:20:44 AM
Yes, yes, I'm working on it.
For me seeing boards means to see on the board index, not to see what is inside. But I already added an option to show the content too.
You'll have the updated version in 24 hours max.
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 04, 2007, 11:25:44 AM
Yes, yes, I'm working on it.
For me seeing boards means to see on the board index, not to see what is inside. But I already added an option to show the content too.
You'll have the updated version in 24 hours max.

Great so the guests will be able to access say the "Tips and Tricks" section but they wont be able to read the threads? They'll just be able to see the subject of each thread? Man that would be PERFECT for what I needed. Show us your magic!
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 04, 2007, 05:39:49 PM
I renamed the mod and it's ready for use.
View Only Boards 1.0
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=610)
Alternate Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/voboards/View_Only_Boards_1.0.zip)

If you have any question post it in the mod's support topic (you will find once it is approved).
Title: Re: Allowing guests to see all Boards but not entering
Post by: justafishermen on January 05, 2007, 01:55:56 AM
Perfect! Simply perfect! This mod does exactly what I need it to do and does it flawlessly! Great job!
Title: Re: Allowing guests to see all Boards but not entering
Post by: Saku on January 11, 2007, 08:57:28 AM
how can I display list of topics from a board that allow only visibility not access, with ssi_recentTopics ?
My modification didn't work
SSI.php
Code: [Select]
$request = db_query("
SELECT
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 500 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]" . !empty($modSettings['cbv_allowMessageIndexView']) ? "
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);
Title: Re: Allowing guests to see all Boards but not entering
Post by: Greek on January 11, 2007, 05:28:46 PM
Thanks! It works!  :D
Title: Re: Allowing guests to see all Boards but not entering
Post by: babjusi on January 11, 2007, 08:27:24 PM
ehm..
i've create a forum for Vip (user with 40 posts) and i want that this forum is visible for all (but non entering/access)!!
smf has many option for permission but it hasn't most important permission (like ipb2)
i hope so  ;)

U could use a password protected board. U can give the password to the VIP group, and the rest can see the board but they can not enter until u dicide to give them the password
Title: Re: Allowing guests to see all Boards but not entering
Post by: Saku on January 12, 2007, 08:45:05 PM
how can I display list of topics from a board that allow only visibility not access, with ssi_recentTopics ?
My modification didn't work
SSI.php
Code: [Select]
$request = db_query("
SELECT
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 500 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]" . !empty($modSettings['cbv_allowMessageIndexView']) ? "
AND ms.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);

still need help with this :(
Title: Re: Allowing guests to see all Boards but not entering
Post by: Oldiesmann on January 18, 2007, 04:50:37 PM
You didn't finish the conditional statement...

Code: [Select]
$request = db_query("
SELECT
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 500 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]" . !empty($modSettings['cbv_allowMessageIndexView']) ? "
AND ms.ID_MSG = t.ID_FIRST_MSG" : '' . "
ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);
Title: Re: Allowing guests to see all Boards but not entering
Post by: Saku on January 18, 2007, 05:25:11 PM
Thanks  :D
Title: Re: Allowing guests to see all Boards but not entering
Post by: h4ni on January 22, 2007, 12:31:11 PM
I renamed the mod and it's ready for use.
View Only Boards 1.0
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=610)
Alternate Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/voboards/View_Only_Boards_1.0.zip)

If you have any question post it in the mod's support topic (you will find once it is approved).
Search Engine can see the topic?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Rudolf on January 22, 2007, 12:33:14 PM
No, if Guests don't have access.
Title: Re: Allowing guests to see all Boards but not entering
Post by: h4ni on January 22, 2007, 01:12:56 PM
ok :(
Title: Re: Allowing guests to see all Boards but not entering
Post by: ketchup on January 24, 2007, 08:21:40 PM
Hi can someone tell me which code I use for this setup

Have have 5 boards some have child boards too

1
2
3
4
5


5 is a mod section- no one can access it but mods

I'd like to make board 2 viewable on the index but only registerd users can acces it.

what should I do...thanks!  :)
Title: Re: Allowing guests to see all Boards but not entering
Post by: hellmet on January 26, 2007, 11:42:01 AM
Thanks Rudolf.. GREAT MOD.
This shud be default in SMF.
Title: Re: Allowing guests to see all Boards but not entering
Post by: babjusi on January 26, 2007, 12:19:33 PM
Thanks Rudolf.. GREAT MOD.
This shud be default in SMF.

It seems such a great mod, but when I click the link to download it I see this message:

Warning: this mod is currently not approved!
Please do not use this mod unless you are completely sure of the consequences!

I don''t dare to use any kind of mod which isn''t yet approved. My question is: Does anyone know when this mod it would be approved? Thank you
Title: Re: Allowing guests to see all Boards but not entering
Post by: teamvtec on January 26, 2007, 12:32:40 PM
Stated in above posts

View Only Boards 1.0
]
Alternate Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/voboards/View_Only_Boards_1.0.zip)


Works fine
Title: Re: Allowing guests to see all Boards but not entering
Post by: babjusi on January 26, 2007, 06:30:04 PM
Stated in above posts

View Only Boards 1.0
]
Alternate Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/voboards/View_Only_Boards_1.0.zip)


Works fine

What I meant is, that isn''t that risky to use a mod which isn''t approved yet?
Title: Re: Allowing guests to see all Boards but not entering
Post by: teamvtec on January 26, 2007, 06:59:08 PM
What I meant is, that isn''t that risky to use a mod which isn''t approved yet?

Why should it be? it's just code... not a trojan horse or something.
And if you have troubles after installing the mod (which i doubt) then ask Rudolf.
I really don't see the problem here.
Title: Re: Allowing guests to see all Boards but not entering
Post by: babjusi on January 26, 2007, 07:21:32 PM
What I meant is, that isn''t that risky to use a mod which isn''t approved yet?

Why should it be? it's just code... not a trojan horse or something.
And if you have troubles after installing the mod (which i doubt) then ask Rudolf.
I really don't see the problem here.


I am very sure that it ain''t anything like that, I was only wondering if it was safe to use a mod if it ain''t approved yet. Personally, I will wait till it gets approved, which I wish it could be very soon, cause I find it a very great and handy mod
Title: Re: Allowing guests to see all Boards but not entering
Post by: Krysia on January 29, 2007, 04:54:46 PM
The mod still hasn't been approved?  ::)

It sounds like the perfect solution. Reading through this topic has made me dizzy, and I'm so glad someone with know-how figured out a mod for creating "incentive boards". ;)

Thank you!
Title: Re: Allowing guests to see all Boards but not entering
Post by: undysided on February 03, 2007, 12:46:22 PM
Hi All

When I try to install the 'View_Only_Boards_1.0' mod on version 1.1.1 I get the following errors. I used the package manager

Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Code DB.php 
2. Execute Modification sources.xml Modification parse error
3. Execute Modification - Modification parse error
4. Execute Modification themes.xml Modification parse error
5. Execute Modification - Modification parse error

How can I fix? All help appreciated
Title: Re: Allowing guests to see all Boards but not entering
Post by: babjusi on February 03, 2007, 12:47:37 PM
The mod still hasn't been approved?  ::)

It sounds like the perfect solution. Reading through this topic has made me dizzy, and I'm so glad someone with know-how figured out a mod for creating "incentive boards". ;)

Thank you!

This mod got approved some days ago now
Title: Re: Allowing guests to see all Boards but not entering
Post by: undysided on February 05, 2007, 08:48:06 AM
Hi All

When I try to install the 'View_Only_Boards_1.0' mod on SMF 1.1.1 I get the following errors. I used the package manager to upload

Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Code DB.php 
2. Execute Modification sources.xml Modification parse error
3. Execute Modification - Modification parse error
4. Execute Modification themes.xml Modification parse error
5. Execute Modification - Modification parse error

How can I fix? All help appreciated

Is there anyone able to help me with the above problem(s)?

Thanks
Title: Re: Allowing guests to see all Boards but not entering
Post by: redone on February 05, 2007, 09:14:50 AM
Make sure the following files are chmodded to 777 or 755 depending on what your host allows:

/Sources/BoardIndex.php   
/Sources/ManageBoards.php   
/Sources/Subs-Boards.php   
Sources/Load.php   
/Sources/ModSettings.php   
/Themes/default/ManageBoards.template.php   
/Themes/default/languages/ManageBoards.english.php
/Themes/default/languages/ModSettings.english.php

I was able to install it without any issues. It could be related to how your web host has the server configured. Can you install other packages without a problem?

Failing that you are left with installing the mod manually I am afraid.

 
Title: Re: Allowing guests to see all Boards but not entering
Post by: undysided on February 05, 2007, 11:11:35 AM
Make sure the following files are chmodded to 777 or 755 depending on what your host allows:

/Sources/BoardIndex.php   
/Sources/ManageBoards.php   
/Sources/Subs-Boards.php   
Sources/Load.php   
/Sources/ModSettings.php   
/Themes/default/ManageBoards.template.php   
/Themes/default/languages/ManageBoards.english.php
/Themes/default/languages/ModSettings.english.php

I was able to install it without any issues. It could be related to how your web host has the server configured. Can you install other packages without a problem?

Failing that you are left with installing the mod manually I am afraid.

Thanks for your reply, I've checked permissions & they are fine. It seems I'm not able upload any kind of mod through package manager so it's probly to do with my host.

Is there anywhere that tells me how to install the View_Only_Boards_1.0 mod manually? I checked the files of the mod to see if there were instructions on how to install manually but couldn't find any

Thanks for your help
Title: Re: Allowing guests to see all Boards but not entering
Post by: Saku on February 11, 2007, 09:24:24 AM
You didn't finish the conditional statement...

Code: [Select]
$request = db_query("
SELECT
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, " . ($user_info['is_guest'] ? '1 AS isRead, 0 AS new_from' : '
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) >= m.ID_MSG_MODIFIED AS isRead,
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ", LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)" : '') . "
WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 500 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]" . !empty($modSettings['cbv_allowMessageIndexView']) ? "
AND ms.ID_MSG = t.ID_FIRST_MSG" : '' . "
ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent", __FILE__, __LINE__);

Didn't work :(

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 'AND ms.ID_MSG = t.ID_FIRST_MSG' at line 1
Fichier: /public_html/smf/SSI.php
Line: 364
Title: Re: Allowing guests to see all Boards but not entering
Post by: vconcept on March 10, 2007, 09:01:15 AM
I'm using the SSI function “SSI_RecentTopics” to display some infos (SMF forum new topics titles) on my homepage. Since I've applied the MOD nobody (also the admins) can show theses infos. To be more precise about how I've configured the MOD, I make it to allow all people to show into the forum the info until the title of the thread. When the user, who is not logged, try to click on a thread to see the content, the system then asks it to logon or to register.


Because I really want that the guests can see at least the topic title into the forum, how can I do to also allow the “SSI RecentTopics” to work again?


Thanks for your help!
 
Title: Re: Allowing guests to see all Boards but not entering
Post by: vconcept on March 16, 2007, 06:32:30 AM
Any idea ?
Title: Re: Allowing guests to see all Boards but not entering
Post by: jeff1osu on March 20, 2007, 05:30:09 PM
Hi All,

I am completely new to SMF so forgive my ignorance.  I have a group of users I would like to put in an Unauthorized group and then allow them only to see the forum topics but not read the threads, post, etc.  I may at a later time pull them out one by one and give them access again.  Any ideas?  Any help would be greatly appreciated.

Thanks,
jeff1osu
Title: Re: Allowing guests to see all Boards but not entering
Post by: daragor on March 23, 2007, 02:15:32 PM
thanks rudolf
Title: Re: Allowing guests to see all Boards but not entering
Post by: Widmo on March 23, 2007, 10:49:34 PM
I renamed the mod and it's ready for use.
View Only Boards 1.0
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=610)
Alternate Download Link to Mod (http://digilander.libero.it/rudoka/smfmods/voboards/View_Only_Boards_1.0.zip)

If you have any question post it in the mod's support topic (you will find once it is approved).

Sorry but this is ******, because i make search topic and enter to him, so i dont must be logged

Sorry for my english
Title: Re: Allowing guests to see all Boards but not entering
Post by: mrandall131 on April 03, 2007, 07:08:10 AM
I'm still using the original "trick" and I have no problems with it at all.  And, just upgraded to the latest version of SMF.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Yellowrose on April 04, 2007, 03:31:26 PM
Ok I've gone through this topic and just can't understand a lot of it. It seems to jump form one type of access and permission to another.

My problem is I run a game fansite. I have enabled access to the boards I want guests to be able view and read and then set permissions so guests can not post. All seems fine but when you acess the board as a guest you ge the message that the board administrator has required you to re4gister  or something like that.

I love SMF and use it on 2 sites

Is there not something that can be done for a view permission to be added to make this easier to do.

most other forum software has this option where you can set a read only option for certain boards and certain membergroups

An example of what I would like to do is this (x = permissions allowed)
                                     guest        guest          guest
board name                    access       read all        post   

general rules                      x             x                  0           
general discussion               x             x                  0         
downloads discussion           x             x                  0         
game info                          x             x                  0


I guess what I am asking for is a read only option for guests based on the board access permission.

I can give them access to read the board and all posts pertaining to say new download releases so they can see what files we have to offer but they can't post

They can see the tech support forum and read everything but can't post

But they can't see anything where the guest access is unchecked

As it stands now I have allowed access to guests for certain boards and childboards in the access and then gone into the usergroups and added permissions for the boards statistics and the gallery and the Search for posts and topics but when I check by trying to log in as a guest I get this message

Warning

Only registered members are allowed to access this section please login below or register an accout with site name

I want guests to be able to have the accesses I have allowed.

This has only come about since the upgrade to 1.1.2 and the addition of TP 9.8 prior to a recent server move and software upgrades my guests were allowed to view the forums where access was given but not post as per usergroup permissions

I have the following mods installed on a fresh install of SMF 1.1.2

 Mod Name                         Version 
1. Reason For Editing Mod      1.14   
2. vWarn Mod                      1.10   
3. Custom Profile Field Mod     3.16     
4. Admin Notepad                 1.0   
5. Save PM as HTML             1.0.2     
6. Country Flags                   1.0.1   
7. TinyPortal                        0.983               
8. PhpInfo                           1.1     
9. SMF                               1.1.2 Update Package 1.1.2 
10. Display Age and Location next to posts    1.0     
11. vReportBoard Mod           0.97     
12. LogModAccountEdits        1.8     
13. Users Online Today Mod   1.4.0     
14. SMF Gallery Lite              1.7.1   
15. Who Voted What?           1.1.2   
16. Gender On Registration     1.0     
17. Move Old Topics              1.2   
18. SmileyLimit                     1.0 
19. nwsw.nwswAdminAttachAnything 1.1 RC3   
20. LimitPostsPerDay             1.1_BETA   
21. Signature Permission         1.0   
 


         
Title: Re: Allowing guests to see all Boards but not entering
Post by: jellybelly on May 11, 2007, 10:13:04 AM
Wow! I find a solution!
I don't believe in myself!!!

well, in boardindex.php i changed:
Code: [Select]
WHERE $user_info[query_see_board]
AND b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);


with:
Code: [Select]
WHERE&nbsp; b.ID_CAT = c.ID_CAT
AND b.childLevel <= 1
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

it's work, now all forum are visible (only eheh ;D)

thank's Oldiesmann for lost time with me....


Thanks for your solution i was looking for this option now when my guests try to enter a forum they are not allowed they get this message

(The topic or board you are looking for appears to be either missing or off limits to you.)
Title: Re: Allowing guests to see all Boards but not entering
Post by: Klozi on May 27, 2007, 05:56:52 AM
Well that's pretty cool, but I need a solution that guests can't access any board but there are two or three boards accessable for guest. I need this for news boards wich SSI.
Title: Re: Allowing guests to see all Boards but not entering
Post by: edchapman on October 08, 2007, 09:43:03 AM
Sorry I know this topic is getting old...
count this as a update I guess.
I'm running 1.1.4 and tried it. It did nothing for me.
I would like guests and google spiders to see what's on the forum but not enter into the topic.
Title: Re: Allowing guests to see all Boards but not entering
Post by: perava1234 on October 11, 2007, 03:23:28 PM
I replace this code in boardIndex:
WHERE $user_info[query_see_board]

with

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

but when i run my web, I have next mistake:

Database Error
Please try again. If you come back to this error screen, report the error to an administrator

when I register, everething ok, but guest have mistake when come on my web
How I decide this problem.
Title: Re: Allowing guests to see all Boards but not entering
Post by: codenaught on November 13, 2007, 12:42:18 AM
That code worked for me peraval1234. Perhaps you can show a little more of the code to see where it could have gone wrong, mine has:

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR b.ID_BOARD IN (1, 2, 3)" : '') . ")" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);
Title: Re: Allowing guests to see all Boards but not entering
Post by: Aileen on November 23, 2007, 01:07:23 AM
Now I have a board that is accesible to Full Member and above and not accesible to JR. Member and Newbie and guest. I was able to to that with the board permissions but the board is not showing up with SR. Member and Newbie as well as guest.

Is it possible to show it to those member groups like the thread I have posted above?

Thank you so much
Title: Re: Allowing guests to see all Boards but not entering
Post by: JenniferW on December 01, 2007, 02:27:59 PM
Whew I have read through this entire thread and done a search and am still unable to find what I'm looking for. I figured out the whole keeping guests out thing but I still want them to be able to see the topic titles and the number of topics and posts on each board but not be able to read the actual posts. I just can't stand it that my boards look empty to guests. Can anyone help? PLEASE! I'm using 1.1.4
Title: Re: Allowing guests to see all Boards but not entering
Post by: AllMassive on December 02, 2007, 06:54:32 PM
JenniferW: Take a look at THIS (http://custom.simplemachines.org/mods/index.php?mod=610) Mod.
Title: Re: Allowing guests to see all Boards but not entering
Post by: taurean on December 03, 2007, 03:12:38 AM
i think ' registered links mod' is a god one. i use that. guests are allowed to view the topics but not any urls until they register/login.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Sarge on December 14, 2007, 05:13:45 AM
Now I have a board that is accesible to Full Member and above and not accesible to JR. Member and Newbie and guest. I was able to to that with the board permissions but the board is not showing up with SR. Member and Newbie as well as guest.

Is it possible to show it to those member groups like the thread I have posted above?

Thank you so much

Go to Admin > Permissions > Settings tab and check the box for "Enable permissions for post count based groups".
Title: Re: Allowing guests to see all Boards but not entering
Post by: SwapsRulez on April 19, 2008, 10:22:28 AM
Can anyone do it in the  SMF 2.0 Beta 3 Public ?
Please do tell the actual edits i have to do ?

I'm too much confused now after reading all this ?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Fiery on June 17, 2008, 02:03:39 AM
Can anyone do it in the  SMF 2.0 Beta 3 Public ?
Please do tell the actual edits i have to do ?

I'm too much confused now after reading all this ?

What are you trying to do?, Sarge explained how to "Enable permissions for post count based groups" above
Title: Re: Allowing guests to see all Boards but not entering
Post by: jack.smith239 on July 11, 2008, 08:57:44 AM
I'm using SMF 1.5 please let me know how I can show board's index to the guests but restrict the view details.
Title: Re: Allowing guests to see all Boards but not entering
Post by: SleePy on July 30, 2008, 01:39:16 AM
Did you look at the tip and trick on the first page?
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa on August 01, 2008, 09:02:03 AM
Hello my friends. I have 1.1.5 and I cannot use any of the tips given before. I dont know what to do because the recent module won´t work.
What I need is see all boards that are accessed by regular users, but not enter, and that they don´t see at all the boards for administrators only. Can someone give me some helpe please?  :-\
Title: Re: Allowing guests to see all Boards but not entering
Post by: haxor1980 on August 06, 2008, 06:51:50 PM
I want to accomplish this as per the original poster:

I want guests to be able to see all the boards, but when the click the board, its says they have no access to it without login. How do I do this. WHen i set permissons in the admin, when your a guest the board just doesnt appear at all to them.   I want it to be able to be seen, but disable access until they are registered.  not sure if this makes sense.

MY version of SMF is SMF 2.0 Beta 3.1 Public.

Please help me to accomplish this.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Adish - (F.L.A.M.E.R) on August 06, 2008, 07:00:57 PM
I have gone through a various codes and comments and finally didnt came up with a fixed answer that which code I have to use ?

I suppose this edit will let the topic names to be viewd but when clicked on the topic, it will ask for username and pass. Is that what i have got it right ?

I am using 1.1.5 version of SMF. Please let me know which one is the right one which I have to use for the forum.

Thank you for this wonderful idea.
Title: Re: Allowing guests to see all Boards but not entering
Post by: haxor1980 on August 06, 2008, 07:08:32 PM
For 1.1.5 did you try the suggestion given in second post of this thrfead?
It may work.

But for SMF 2.0 nothing really works and I m damn frustrate now.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Adish - (F.L.A.M.E.R) on August 06, 2008, 07:11:04 PM
For 1.1.5 did you try the suggestion given in second post of this thrfead?
It may work.

Can you give me the link of that post please. Just click on the header of the message and paste it here, i will have a look there.

Thank You.
Title: Re: Allowing guests to see all Boards but not entering
Post by: JustJa on August 07, 2008, 06:37:33 PM
I might have been blind... It really works! Thank you so much!

Sources/BoardIndex.php, find:

Code: [Select]
WHERE $user_info[query_see_board]


Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: Shark-Time on November 09, 2008, 03:24:21 PM
Hey Guys im new here...Well i also want to make guests see the board but they could not enter..Well i tried but i couldnt did...Well i hope u guys can help by editing the below code post the edited one...I tried it much b4... Well i have installed SMF 1.1.6

Code: [Select]
<?php
/**********************************************************************************
* BoardIndex.php                                                                  *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* The single function this file contains is used to display the main
board index.  It uses just the following functions:

void BoardIndex()
- shows the board index.
- uses the BoardIndex template, and main sub template.
- may use the boardindex subtemplate for wireless support.
- updates the most online statistics.
- is accessed by ?action=boardindex.

bool calendarDoIndex()
- prepares the calendar data for the board index.
- takes care of caching it for speed.
- depends upon these settings: cal_showeventsonindex,
  cal_showbdaysonindex, cal_showholidaysonindex.
- returns whether there is anything to display.
*/

// Show the board index!
function BoardIndex()
{
global $txt$scripturl$db_prefix$ID_MEMBER$user_info$sourcedir;
global $modSettings$context$settings;

// For wireless, we use the Wireless template...
if (WIRELESS)
$context['sub_template'] = WIRELESS_PROTOCOL '_boardindex';
else
loadTemplate('BoardIndex');

// Remember the most recent topic for optimizing the recent posts feature.
$most_recent_topic = array(
'timestamp' => 0,
'ref' => null
);

// Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control.
$result_boards db_query("
SELECT
c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description,
b.numPosts, b.numTopics, b.ID_PARENT, IFNULL(m.posterTime, 0) AS posterTime,
IFNULL(mem.memberName, m.posterName) AS posterName, m.subject, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName," 
. ($user_info['is_guest'] ? "
1 AS isRead, 0 AS new_from" 
"
(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead, IFNULL(lb.ID_MSG, -1) + 1 AS new_from,
c.canCollapse, IFNULL(cc.ID_MEMBER, 0) AS isCollapsed"
) . ",
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, m.ID_MSG,
IFNULL(mods_mem.ID_MEMBER, 0) AS ID_MODERATOR, mods_mem.realName AS modRealName
FROM 
{$db_prefix}boards AS b
LEFT JOIN 
{$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN 
{$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN 
{$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
LEFT JOIN 
{$db_prefix}collapsed_categories AS cc ON (cc.ID_CAT = c.ID_CAT AND cc.ID_MEMBER = $ID_MEMBER)" '') . "
LEFT JOIN 
{$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN 
{$db_prefix}members AS mods_mem ON (mods_mem.ID_MEMBER = mods.ID_MEMBER)
WHERE 
$user_info[query_see_board]. (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" 
''), __FILE____LINE__);

// Run through the categories and boards....
$context['categories'] = array();
while ($row_board mysql_fetch_assoc($result_boards))
{
// Haven't set this category yet.
if (empty($context['categories'][$row_board['ID_CAT']]))
{
$context['categories'][$row_board['ID_CAT']] = array(
'id' => $row_board['ID_CAT'],
'name' => $row_board['catName'],
'is_collapsed' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == && $row_board['isCollapsed'] > 0,
'can_collapse' => isset($row_board['canCollapse']) && $row_board['canCollapse'] == 1,
'collapse_href' => isset($row_board['canCollapse']) ? $scripturl '?action=collapse;c=' $row_board['ID_CAT'] . ';sa=' . ($row_board['isCollapsed'] > 'expand' 'collapse;') . '#' $row_board['ID_CAT'] : '',
'collapse_image' => isset($row_board['canCollapse']) ? '<img src="' $settings['images_url'] . '/' . ($row_board['isCollapsed'] > 'expand.gif" alt="+"' 'collapse.gif" alt="-"') . ' border="0" />' '',
'href' => $scripturl '#' $row_board['ID_CAT'],
'boards' => array(),
'new' => false
);
$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' $row_board['ID_CAT'] . '" href="' . (isset($row_board['canCollapse']) ? $context['categories'][$row_board['ID_CAT']]['collapse_href'] : $context['categories'][$row_board['ID_CAT']]['href']) . '">' $row_board['catName'] . '</a>';
}

// If this board has new posts in it (and isn't the recycle bin!) then the category is new.
if (empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $row_board['ID_BOARD'])
$context['categories'][$row_board['ID_CAT']]['new'] |= empty($row_board['isRead']) && $row_board['posterName'] != '';

// Collapsed category - don't do any of this.
if ($context['categories'][$row_board['ID_CAT']]['is_collapsed'])
continue;

// Let's save some typing.  Climbing the array might be slower, anyhow.
$this_category = &$context['categories'][$row_board['ID_CAT']]['boards'];

// This is a parent board.
if (empty($row_board['ID_PARENT']))
{
// Is this a new board, or just another moderator?
if (!isset($this_category[$row_board['ID_BOARD']]))
{
// Not a child.
$isChild false;

$this_category[$row_board['ID_BOARD']] = array(
'new' => empty($row_board['isRead']),
'id' => $row_board['ID_BOARD'],
'name' => $row_board['boardName'],
'description' => $row_board['description'],
'moderators' => array(),
'link_moderators' => array(),
'children' => array(),
'link_children' => array(),
'children_new' => false,
'topics' => $row_board['numTopics'],
'posts' => $row_board['numPosts'],
'href' => $scripturl '?board=' $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' $scripturl '?board=' $row_board['ID_BOARD'] . '.0">' $row_board['boardName'] . '</a>'
);
}
if (!empty($row_board['ID_MODERATOR']))
{
$this_category[$row_board['ID_BOARD']]['moderators'][$row_board['ID_MODERATOR']] = array(
'id' => $row_board['ID_MODERATOR'],
'name' => $row_board['modRealName'],
'href' => $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'],
'link' => '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'] . '" title="' $txt[62] . '">' $row_board['modRealName'] . '</a>'
);
$this_category[$row_board['ID_BOARD']]['link_moderators'][] = '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MODERATOR'] . '" title="' $txt[62] . '">' $row_board['modRealName'] . '</a>';
}
}
// Found a child board.... make sure we've found its parent and the child hasn't been set already.
elseif (isset($this_category[$row_board['ID_PARENT']]['children']) && !isset($this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]))
{
// A valid child!
$isChild true;

$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']] = array(
'id' => $row_board['ID_BOARD'],
'name' => $row_board['boardName'],
'description' => $row_board['description'],
'new' => empty($row_board['isRead']) && $row_board['posterName'] != '',
'topics' => $row_board['numTopics'],
'posts' => $row_board['numPosts'],
'href' => $scripturl '?board=' $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' $scripturl '?board=' $row_board['ID_BOARD'] . '.0">' $row_board['boardName'] . '</a>'
);

// Counting child board posts is... slow :/.
if (!empty($modSettings['countChildPosts']))
{
$this_category[$row_board['ID_PARENT']]['posts'] += $row_board['numPosts'];
$this_category[$row_board['ID_PARENT']]['topics'] += $row_board['numTopics'];
}

// Does this board contain new boards?
$this_category[$row_board['ID_PARENT']]['children_new'] |= empty($row_board['isRead']);

// This is easier to use in many cases for the theme....
$this_category[$row_board['ID_PARENT']]['link_children'][] = &$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['link'];
}
// Child of a child... just add it on...
elseif (!empty($modSettings['countChildPosts']))
{
if (!isset($parent_map))
$parent_map = array();

if (!isset($parent_map[$row_board['ID_PARENT']]))
foreach ($this_category as $id => $board)
{
if (!isset($board['children'][$row_board['ID_PARENT']]))
continue;

$parent_map[$row_board['ID_PARENT']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['ID_PARENT']]);
$parent_map[$row_board['ID_BOARD']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['ID_PARENT']]);

break;
}

if (isset($parent_map[$row_board['ID_PARENT']]))
{
$parent_map[$row_board['ID_PARENT']][0]['posts'] += $row_board['numPosts'];
$parent_map[$row_board['ID_PARENT']][0]['topics'] += $row_board['numTopics'];
$parent_map[$row_board['ID_PARENT']][1]['posts'] += $row_board['numPosts'];
$parent_map[$row_board['ID_PARENT']][1]['topics'] += $row_board['numTopics'];

continue;
}

continue;
}
// Found a child of a child - skip.
else
continue;

// Prepare the subject, and make sure it's not too long.
censorText($row_board['subject']);
$row_board['short_subject'] = shorten_subject($row_board['subject'], 24);
$this_last_post = array(
'id' => $row_board['ID_MSG'],
'time' => $row_board['posterTime'] > timeformat($row_board['posterTime']) : $txt[470],
'timestamp' => forum_time(true$row_board['posterTime']),
'subject' => $row_board['short_subject'],
'member' => array(
'id' => $row_board['ID_MEMBER'],
'username' => $row_board['posterName'] != '' $row_board['posterName'] : $txt[470],
'name' => $row_board['realName'],
'href' => $row_board['posterName'] != '' && !empty($row_board['ID_MEMBER']) ? $scripturl '?action=profile;u=' $row_board['ID_MEMBER'] : '',
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' $scripturl '?action=profile;u=' $row_board['ID_MEMBER'] . '">' $row_board['realName'] . '</a>' $row_board['realName']) : $txt[470],
),
'start' => 'msg' $row_board['new_from'],
'topic' => $row_board['ID_TOPIC']
);

// Provide the href and link.
if ($row_board['subject'] != '')
{
$this_last_post['href'] = $scripturl '?topic=' $row_board['ID_TOPIC'] . '.msg' . ($user_info['is_guest'] ? $modSettings['maxMsgID'] : $row_board['new_from']) . (empty($row_board['isRead']) ? ';boardseen' '') . '#new';
$this_last_post['link'] = '<a href="' $this_last_post['href'] . '" title="' $row_board['subject'] . '">' $row_board['short_subject'] . '</a>';
}
else
{
$this_last_post['href'] = '';
$this_last_post['link'] = $txt[470];
}

// Set the last post in the parent board.
if (empty($row_board['ID_PARENT']) || ($isChild && !empty($row_board['posterTime']) && $this_category[$row_board['ID_PARENT']]['last_post']['timestamp'] < forum_time(true$row_board['posterTime'])))
$this_category[$isChild $row_board['ID_PARENT'] : $row_board['ID_BOARD']]['last_post'] = $this_last_post;
// Just in the child...?
if ($isChild)
{
$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['last_post'] = $this_last_post;

// If there are no posts in this board, it really can't be new...
$this_category[$row_board['ID_PARENT']]['children'][$row_board['ID_BOARD']]['new'] &= $row_board['posterName'] != '';
}
// No last post for this board?  It's not new then, is it..?
elseif ($row_board['posterName'] == '')
$this_category[$row_board['ID_BOARD']]['new'] = false;

// Determine a global most recent topic.
if (!empty($row_board['posterTime']) && forum_time(true$row_board['posterTime']) > $most_recent_topic['timestamp'])
$most_recent_topic = array(
'timestamp' => forum_time(true$row_board['posterTime']),
'ref' => &$this_category[$isChild $row_board['ID_PARENT'] : $row_board['ID_BOARD']]['last_post'],
);
}
mysql_free_result($result_boards);

// Load the users online right now.
$result db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM 
{$db_prefix}log_online AS lo
LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))"__FILE____LINE__);

$context['users_online'] = array();
$context['list_users_online'] = array();
$context['online_groups'] = array();
$context['num_guests'] = 0;
$context['num_buddies'] = 0;
$context['num_users_hidden'] = 0;

$context['show_buddies'] = !empty($user_info['buddies']);

while ($row mysql_fetch_assoc($result))
{
if (empty($row['realName']))
{
$context['num_guests']++;
continue;
}
elseif (empty($row['showOnline']) && !allowedTo('moderate_forum'))
{
$context['num_users_hidden']++;
continue;
}

// Some basic color coding...
if (!empty($row['onlineColor']))
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '" style="color: ' $row['onlineColor'] . ';">' $row['realName'] . '</a>';
else
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '">' $row['realName'] . '</a>';

$is_buddy in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$context['num_buddies']++;
$link '<b>' $link '</b>';
}

$context['users_online'][$row['logTime'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl '?action=profile;u=' $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$context['list_users_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' $link '</i>' $link;

if (!isset($context['online_groups'][$row['ID_GROUP']]))
$context['online_groups'][$row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'color' => $row['onlineColor']
);
}
mysql_free_result($result);

krsort($context['users_online']);
krsort($context['list_users_online']);
ksort($context['online_groups']);

$context['num_users_online'] = count($context['users_online']) + $context['num_users_hidden'];

// Track most online statistics?
if (!empty($modSettings['trackStats']))
{
// Determine the most users online - both all time and per day.
$total_users $context['num_guests'] + $context['num_users_online'];

// More members on now than ever were?  Update it!
if (!isset($modSettings['mostOnline']) || $total_users >= $modSettings['mostOnline'])
updateSettings(array('mostOnline' => $total_users'mostDate' => time()));

$date strftime('%Y-%m-%d'forum_time(false));

// One or more stats are not up-to-date?
if (!isset($modSettings['mostOnlineUpdated']) || $modSettings['mostOnlineUpdated'] != $date)
{
$request db_query("
SELECT mostOn
FROM 
{$db_prefix}log_activity
WHERE date = '
$date'
LIMIT 1"
__FILE____LINE__);

// The log_activity hasn't got an entry for today?
if (mysql_num_rows($request) == 0)
{
db_query("
INSERT IGNORE INTO 
{$db_prefix}log_activity
(date, mostOn)
VALUES ('
$date', $total_users)"__FILE____LINE__);
}
// There's an entry in log_activity on today...
else
{
list ($modSettings['mostOnlineToday']) = mysql_fetch_row($request);

if ($total_users $modSettings['mostOnlineToday'])
trackStats(array('mostOn' => $total_users));

$total_users max($total_users$modSettings['mostOnlineToday']);
}
mysql_free_result($request);

updateSettings(array('mostOnlineUpdated' => $date'mostOnlineToday' => $total_users));
}
// Highest number of users online today?
elseif ($total_users $modSettings['mostOnlineToday'])
{
trackStats(array('mostOn' => $total_users));
updateSettings(array('mostOnlineUpdated' => $date'mostOnlineToday' => $total_users));
}
}

// Set the latest member.
$context['latest_member'] = &$context['common_stats']['latest_member'];

// Load the most recent post?
if ((!empty($settings['number_recent_posts']) && $settings['number_recent_posts'] == 1) || $settings['show_sp1_info'])
$context['latest_post'] = $most_recent_topic['ref'];

if (!empty($settings['number_recent_posts']) && $settings['number_recent_posts'] > 1)
{
require_once($sourcedir '/Recent.php');

if (($context['latest_posts'] = cache_get_data('boardindex-latest_posts:' md5($user_info['query_see_board'] . $user_info['language']), 180)) == null)
{
$context['latest_posts'] = getLastPosts($settings['number_recent_posts']);
cache_put_data('boardindex-latest_posts:' md5($user_info['query_see_board'] . $user_info['language']), $context['latest_posts'], 180);
}

// We have to clean up the cached data a bit.
foreach ($context['latest_posts'] as $k => $post)
{
$context['latest_posts'][$k]['time'] = timeformat($post['raw_timestamp']);
$context['latest_posts'][$k]['timestamp'] = forum_time(true$post['raw_timestamp']);
}
}

$settings['display_recent_bar'] = !empty($settings['number_recent_posts']) ? $settings['number_recent_posts'] : 0;
$settings['show_member_bar'] &= allowedTo('view_mlist');
$context['show_stats'] = allowedTo('view_stats') && !empty($modSettings['trackStats']);
$context['show_member_list'] = allowedTo('view_mlist');
$context['show_who'] = allowedTo('who_view') && !empty($modSettings['who_enabled']);

// Set some permission related settings.
$context['show_login_bar'] = $user_info['is_guest'] && !empty($modSettings['enableVBStyleLogin']);
$context['show_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);

// Load the calendar?
if ($context['show_calendar'])
$context['show_calendar'] = calendarDoIndex();

$context['page_title'] = $txt[18];
}

// Called from the BoardIndex to display the current day's events on the board index.
function calendarDoIndex()
{
global $modSettings$context$user_info$scripturl$sc$ID_MEMBER;

// Make sure at least one of the options is checked.
if (empty($modSettings['cal_showeventsonindex']) && empty($modSettings['cal_showbdaysonindex']) && empty($modSettings['cal_showholidaysonindex']))
return false;

// Get the current forum time and check whether the statistics are up to date.
if (empty($modSettings['cal_today_updated']) || $modSettings['cal_today_updated'] != strftime('%Y%m%d'forum_time(false)))
updateStats('calendar');

// Load the holidays for today, ...
if (!empty($modSettings['cal_showholidaysonindex']) && isset($modSettings['cal_today_holiday']))
$holidays unserialize($modSettings['cal_today_holiday']);
// ... the birthdays for today, ...
if (!empty($modSettings['cal_showbdaysonindex']) && isset($modSettings['cal_today_birthday']))
$bday unserialize($modSettings['cal_today_birthday']);
// ... and the events for today.
if (!empty($modSettings['cal_showeventsonindex']) && isset($modSettings['cal_today_event']))
$events unserialize($modSettings['cal_today_event']);

// No events, birthdays, or holidays... don't show anything.  Simple.
if (empty($holidays) && empty($bday) && empty($events))
return false;

// This shouldn't be less than one!
if (empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1)
$days_for_index 86400;
else
$days_for_index $modSettings['cal_days_for_index'] * 86400;

$context['calendar_only_today'] = $modSettings['cal_days_for_index'] == 1;

// Get the current member time/date.
$now forum_time();

// This is used to show the "how-do-I-edit" help.
$context['calendar_can_edit'] = allowedTo('calendar_edit_any');

// Holidays between now and now + days.
$context['calendar_holidays'] = array();
for ($i $now$i $now $days_for_index$i += 86400)
{
if (isset($holidays[strftime('%Y-%m-%d'$i)]))
$context['calendar_holidays'] = array_merge($context['calendar_holidays'], $holidays[strftime('%Y-%m-%d'$i)]);
}

// Happy Birthday, guys and gals!
$context['calendar_birthdays'] = array();
for ($i $now$i $now $days_for_index$i += 86400)
if (isset($bday[strftime('%Y-%m-%d'$i)]))
{
foreach ($bday[strftime('%Y-%m-%d'$i)] as $index => $dummy)
$bday[strftime('%Y-%m-%d'$i)][$index]['is_today'] = strftime('%Y-%m-%d'$i) == strftime('%Y-%m-%d'forum_time());
$context['calendar_birthdays'] = array_merge($context['calendar_birthdays'], $bday[strftime('%Y-%m-%d'$i)]);
}

$context['calendar_events'] = array();
$duplicates = array();
for ($i $now$i $now $days_for_index$i += 86400)
{
if (empty($events[strftime('%Y-%m-%d'$i)]))
continue;

foreach ($events[strftime('%Y-%m-%d'$i)] as $ev => $event)
{
if (empty($event['topic']) || (count(array_intersect($user_info['groups'], $event['allowed_groups'])) != || allowedTo('admin_forum')))
{
if (isset($duplicates[$events[strftime('%Y-%m-%d'$i)][$ev]['topic'] . $events[strftime('%Y-%m-%d'$i)][$ev]['title']]))
{
unset($events[strftime('%Y-%m-%d'$i)][$ev]);
continue;
}

$this_event = &$events[strftime('%Y-%m-%d'$i)][$ev];
$this_event['href'] = $this_event['topic'] == '' $scripturl '?topic=' $this_event['topic'] . '.0';
$this_event['modify_href'] = $scripturl '?action=' . ($this_event['topic'] == 'calendar;sa=post;' 'post;msg=' $this_event['msg'] . ';topic=' $this_event['topic'] . '.0;calendar;') . 'eventid=' $this_event['id'] . ';sesc=' $sc;
$this_event['can_edit'] = allowedTo('calendar_edit_any') || ($this_event['poster'] == $ID_MEMBER && allowedTo('calendar_edit_own'));
$this_event['is_today'] = (strftime('%Y-%m-%d'$i)) == strftime('%Y-%m-%d'forum_time());
$this_event['date'] = strftime('%Y-%m-%d'$i);

$duplicates[$this_event['topic'] . $this_event['title']] = true;
}
else
unset($events[strftime('%Y-%m-%d'$i)][$ev]);
}

if (!empty($events[strftime('%Y-%m-%d'$i)]))
$context['calendar_events'] = array_merge($context['calendar_events'], $events[strftime('%Y-%m-%d'$i)]);
}

for ($i 0$n count($context['calendar_birthdays']); $i $n$i++)
$context['calendar_birthdays'][$i]['is_last'] = !isset($context['calendar_birthdays'][$i 1]);
for ($i 0$n count($context['calendar_events']); $i $n$i++)
$context['calendar_events'][$i]['is_last'] = !isset($context['calendar_events'][$i 1]);

// This is used to make sure the header should be displayed.
return !empty($context['calendar_holidays']) || !empty($context['calendar_birthdays']) || !empty($context['calendar_events']);
}

?>

It will be your greatness....Thanks in advance...
Title: Re: Allowing guests to see all Boards but not entering
Post by: Deprecated on November 09, 2008, 03:28:44 PM
I've just seen this topic for the first time, and it amuses me because I had a similar problem so I wrote a mod package to handle it.

Look But No Read (http://custom.simplemachines.org/mods/index.php?mod=1332)

I'm not sure if this is exactly what is wanted due to the inexact language of the OP. This mod lets guests see all the boards and see the titles of the topics, but they have to login to read the topics.

Perhaps not exactly the same thing, but maybe some might like the mod even better. It's a "teaser" mod to entice people to register as members.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Shark-Time on November 09, 2008, 04:18:20 PM
hey thanks... i think this mod have been installed..but havent checked it...and will reply u back...thnx for help...
Title: Re: Allowing guests to see all Boards but not entering
Post by: Shark-Time on November 09, 2008, 04:25:42 PM
Dude it didnt worked out...The board is also unable to see for guest user....

i want that guest can see the board but cant access it..it should ask for registration...
Title: Re: Allowing guests to see all Boards but not entering
Post by: Jhez on November 12, 2008, 07:19:23 AM
I would like all Guests to see, but not be able to enter, all the boards they would get access to by registering (one standard group). Is this similar to OP?

 ;)
Title: Re: Allowing guests to see all Boards but not entering
Post by: [SiNaN] on December 06, 2008, 11:02:06 AM
I would like all Guests to see, but not be able to enter, all the boards they would get access to by registering (one standard group). Is this similar to OP?

Try this mod:

http://custom.simplemachines.org/mods/index.php?mod=1332
Title: Re: Guests
Post by: JuzMazaaaZeus on December 07, 2008, 01:45:58 AM
Sources/BoardIndex.php, find:

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

Code: [Select]
WHERE ($user_info[query_see_board]" . ($user_info['is_guest'] ? " OR FIND_IN_SET('0', b.memberGroups)" : '') . ")
--> Tips and Tricks.

-[Unknown]

I am surely going to try it !!!
Thanks !!!
Title: Re: Allowing guests to see all Boards but not entering
Post by: mototalkuk on March 23, 2009, 03:36:03 AM
I would like all Guests to see, but not be able to enter, all the boards they would get access to by registering (one standard group). Is this similar to OP?



http://custom.simplemachines.org/mods/index.php?mod=1332


I've just tried this on 1.1.8 and it appears to work well so far with no bugs found.  Thanks very much!
Title: Re: Allowing guests to see all Boards but not entering
Post by: bosmolskate on March 23, 2009, 03:33:09 PM
Great tips and advice!
Title: Re: Allowing guests to see all Boards but not entering
Post by: HabForms on April 07, 2009, 07:45:13 AM
i cant find the code my site is www.habforms.com
Title: Re: Allowing guests to see all Boards but not entering
Post by: Dragooon on April 24, 2009, 06:33:51 AM
Did you get this issue solved? If not, you can have a look at this (http://custom.simplemachines.org/mods/index.php?mod=610) mod.
Title: Re: Allowing guests to see all Boards but not entering
Post by: B1gft on November 29, 2010, 09:32:11 AM
Is there an update on this code as when I went into the the file coding on the line was different than shown.
I assume it could have slightly changed as the script progressed.
thanks
Title: Re: Allowing guests to see all Boards but not entering
Post by: paulwiggy on November 30, 2010, 07:39:05 AM
Hi, could someone help me with a simple question.  Is it possible to configure this product so that user must register before they can see anything on any of the forums
Title: Re: Allowing guests to see all Boards but not entering
Post by: Illori on November 30, 2010, 10:56:39 AM
in admin->features and option you can disable guests from viewing your whole forum.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Masterd on November 30, 2010, 02:13:59 PM
Hi, could someone help me with a simple question.  Is it possible to configure this product so that user must register before they can see anything on any of the forums


Find this in Sources/Load.php:

Code: [Select]
// Now check if the user is a moderator.
$user_info['is_mod'] = isset($board_info['moderators'][$user_info['id']]);

if (count(array_intersect($user_info['groups'], $board_info['groups'])) == 0 && !$user_info['is_admin'])
$board_info['error'] = 'access';


Replace that with this:

Code: [Select]
// Now check if the user is a moderator.
$user_info['is_mod'] = isset($board_info['moderators'][$user_info['id']]);

if ((count(array_intersect($user_info['groups'], $board_info['groups'])) == 0 && !$user_info['is_admin']) || (!empty($topic) && $user_info['is_guest']))
        $board_info['error'] = 'access';

Title: Re: Allowing guests to see all Boards but not entering
Post by: #socialmedialikers# on June 03, 2012, 07:55:31 PM
mine says
'boardindex-latest_posts:' . md5($user_info[query_wanna_see_board]" .
What to do?
Title: Re: Allowing guests to see all Boards but not entering
Post by: tMicky on September 22, 2012, 07:43:09 AM
is there an update? the trick below no longer works -

Code: [Select]

WHERE $user_info[query_see_board]


Replace with:

Code:

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


--> Tips and Tricks.

-[Unknown]
Title: Re: Allowing guests to see all Boards but not entering
Post by: ElviraS on September 23, 2012, 11:25:35 AM
Is there an update on how this trick can be done for SMF version 2.0.2?
Title: Re: Allowing guests to see all Boards but not entering
Post by: TheListener on September 23, 2012, 05:16:51 PM
Try the View Only Boards Mod.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Elliiott on December 25, 2014, 08:58:00 AM
Friends this code no longer works, anyone know how to do this for those who use 2.0.9 thanks!

Code: [Select]
WHERE $user_info[query_see_board]


Replace with:

Code:

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


--> Tips and Tricks.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Arantor on December 25, 2014, 09:35:07 AM
Use View Only Boards (http://custom.simplemachines.org/mods/index.php?mod=610) instead.
Title: Re: Allowing guests to see all Boards but not entering
Post by: marcio.mendes on December 25, 2014, 08:15:08 PM
Use View Only Boards (http://custom.simplemachines.org/mods/index.php?mod=610) instead.

this works on SMF 2.0.9??
Title: Re: Allowing guests to see all Boards but not entering
Post by: karaflas on January 18, 2015, 06:58:48 PM
Use View Only Boards (http://custom.simplemachines.org/mods/index.php?mod=610) instead.

this works on SMF 2.0.9??

bump, and if it doesn't how can we apply such mod in 2.0.9?
Title: Re: Allowing guests to see all Boards but not entering
Post by: stuffedanimals on January 21, 2015, 12:43:31 AM
I tried but it didn't work. Could you please check it and share with us again? Tks.
Title: Re: Allowing guests to see all Boards but not entering
Post by: Kindred on January 21, 2015, 11:16:45 AM
"didn't work" isn't a great description.

HOW did it not work?

What error(s) did you get?
Did it say something like - this mod is not compatible with your version of SMF?
if so: http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

did it give your errors during the installation tests?
if so: http://wiki.simplemachines.org/smf/Error_in_mod_installation

did it install but fails to work or gives errors when you attempt to use it?
If so: Please detail the specific error or problem
Title: Re: Allowing guests to see all Boards but not entering
Post by: Biology Forums on January 21, 2015, 09:06:09 PM
What if we want a specific board to be seen, but cannot entire as a guest?
Title: Re: Allowing guests to see all Boards but not entering
Post by: Deprecated on February 10, 2015, 12:28:14 AM
I'm chuckling at your answer Kindred. I get that all the time. Doesn't work or doesn't work with XYZ site, and all I know is I have a complainer who is incomprehensible.

Anybody who knows me and I know you, I'll tell you what I'm working on lately. (PM) Other than the smaller size of the open source project it's almost a microcosm of SMF.

I sometimes want to kill new members for posts like "it doesn't work" and not giving me a test scenario that fails. I have a supermod that has filled my forum with stickies in failed attempts to tell members how to file a proper report so we can fix it. It amuses me to watch his fruitless work. I sure appreciate his efforts though, at least somebody is doing something while I'm slinging code.

I'm too busy working on the new release to handle people who can't ask a comprehensible question.
Title: Re: Allowing guests to see all Boards but not entering
Post by: fishoaus on January 09, 2016, 06:37:02 PM
I want guests to be able to see all the boards, but when the click the board, its says they have no access to it without login. How do I do this. WHen i set permissons in the admin, when your a guest the board just doesnt appear at all to them.   I want it to be able to be seen, but disable access until they are registered.  not sure if this makes sense.

[edit] changed topic title [/edit]

does this option allow  Individual  topics  with this fix see attachment  to make guest sign up
Title: Re: Allowing guests to see all Boards but not entering
Post by: lordoftheflies1 on January 11, 2016, 05:31:18 PM
I'm chuckling at your answer Kindred. I get that all the time. Doesn't work or doesn't work with XYZ site, and all I know is I have a complainer who is incomprehensible.

Anybody who knows me and I know you, I'll tell you what I'm working on lately. (PM) Other than the smaller size of the open source project it's almost a microcosm of SMF.

I sometimes want to kill new members for posts like "it doesn't work" and not giving me a test scenario that fails. I have a supermod that has filled my forum with stickies in failed attempts to tell members how to file a proper report so we can fix it. It amuses me to watch his fruitless work. I sure appreciate his efforts though, at least somebody is doing something while I'm slinging code.

I'm too busy working on the new release to handle people who can't ask a comprehensible question.

Well put, i would love for that supermod of yours to come work with some people i know... lol