Advertisement:

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

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Allowing guests to see all Boards but not entering
« 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]
« Last Edit: September 29, 2004, 02:22:40 AM by A.M.A »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Guests
« Reply #1 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]

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: Guests
« Reply #2 on: September 05, 2004, 11:51:57 PM »
ha i thought you could just do this with the permissions...but i guess not

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Guests
« Reply #3 on: September 05, 2004, 11:54:07 PM »
thanks. worked perfectly.
« Last Edit: September 06, 2004, 12:00:38 AM by trenchteam »

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Guests
« Reply #4 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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Guests
« Reply #5 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]

Offline farg

  • Semi-Newbie
  • *
  • Posts: 89
  • Gender: Male
  • Italian Power
Re: Allowing guests to see all Boards but not entering
« Reply #6 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)

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,205
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Allowing guests to see all Boards but not entering
« Reply #7 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?

Offline farg

  • Semi-Newbie
  • *
  • Posts: 89
  • Gender: Male
  • Italian Power
Re: Allowing guests to see all Boards but not entering
« Reply #8 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  ;)

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,205
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Allowing guests to see all Boards but not entering
« Reply #9 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...

Offline farg

  • Semi-Newbie
  • *
  • Posts: 89
  • Gender: Male
  • Italian Power
Re: Allowing guests to see all Boards but not entering
« Reply #10 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!  :'(

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,205
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Allowing guests to see all Boards but not entering
« Reply #11 on: December 02, 2004, 10:57:12 AM »
Ok. Give me a minute to look at something and see what I can do here...

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,205
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Allowing guests to see all Boards but not entering
« Reply #12 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.

Offline farg

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

Offline farg

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

Offline Oldiesmann

  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 24,205
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Allowing guests to see all Boards but not entering
« Reply #15 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';

Offline farg

  • Semi-Newbie
  • *
  • Posts: 89
  • Gender: Male
  • Italian Power
Re: Allowing guests to see all Boards but not entering
« Reply #16 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)

Offline [Unknown]

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

Offline Trekkie101

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,154
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @dlrproundup on Twitter
    • DLRP Roundup
Re: Allowing guests to see all Boards but not entering
« Reply #18 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.