Advertisement:

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

Offline 3fifty

  • Jr. Member
  • **
  • Posts: 188
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #40 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. 

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #41 on: May 15, 2005, 12:32:02 AM »
I posted that somewhere else.  Search for "is_not_guest".

-[Unknown]

BlackMagicWoman

  • Guest
Re: Allowing guests to see all Boards but not entering
« Reply #42 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

Offline stargazer_1017

  • Jr. Member
  • **
  • Posts: 123
  • Gender: Female
Re: Allowing guests to see all Boards but not entering
« Reply #43 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

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Allowing guests to see all Boards but not entering
« Reply #44 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.

Offline ApocryphA

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #45 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?

Offline ApocryphA

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #46 on: June 25, 2005, 04:31:22 AM »
Hmm... anyone?   :-\

SeaOfSin

  • Guest
Re: Allowing guests to see all Boards but not entering
« Reply #47 on: June 25, 2005, 03:23:38 PM »
What happens to the online users today mod? Have you tried reinstalling it?

Sea Of Sin

Offline ApocryphA

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #48 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?


Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #49 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]

Offline ApocryphA

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #50 on: June 26, 2005, 07:38:54 AM »
Will do.  Thanks!

Offline jazz

  • Jr. Member
  • **
  • Posts: 331
Re: Allowing guests to see all Boards but not entering
« Reply #51 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?

Offline ApocryphA

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #52 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.

Offline mrandall131

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
    • Killing Authority
Re: Allowing guests to see all Boards but not entering
« Reply #53 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?

-[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.
« Last Edit: July 27, 2005, 01:03:31 PM by mrandall131 »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Allowing guests to see all Boards but not entering
« Reply #54 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]

Offline mrandall131

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
    • Killing Authority
Re: Allowing guests to see all Boards but not entering
« Reply #55 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]!!!
« Last Edit: July 28, 2005, 06:17:59 AM by mrandall131 »

Offline mrandall131

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
    • Killing Authority
Re: Allowing guests to see all Boards but not entering
« Reply #56 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.
« Last Edit: July 28, 2005, 11:08:24 PM by mrandall131 »

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Allowing guests to see all Boards but not entering
« Reply #57 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.

Offline mrandall131

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
    • Killing Authority
Re: Allowing guests to see all Boards but not entering
« Reply #58 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.

Kramer

  • Guest
Re: Allowing guests to see all Boards but not entering
« Reply #59 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?