News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Allowing guests to see all Boards but not entering

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

Previous topic - Next topic

mrandall131

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?

Cottelletje

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)
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Captain_Morrigan

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



Replace with:

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.

meadwench

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?
Vicky Rowe
Health and Weight Loss Coach
http://www.hcgloss.com
SMF 2.0 RC3, Joomla 1.5.8

meadwench

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?!!
Vicky Rowe
Health and Weight Loss Coach
http://www.hcgloss.com
SMF 2.0 RC3, Joomla 1.5.8

meadwench

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?
Vicky Rowe
Health and Weight Loss Coach
http://www.hcgloss.com
SMF 2.0 RC3, Joomla 1.5.8

fiver

#146
Hi meadwench,

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

Hide Board
If user doesn't have this permission, he can not enter the board that he can see.

Read Topic Permission
Check out my website's Notice Board. 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.

:)





Farmacija

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

$user_info[query_see_board]

Replace with:

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

-[Unknown]

it doesnt work. Guest still can see and read the topics
www.farmaceuti.com
www.farmaceuti.com/tekstovi

CLICKBANKS.NET

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?

Farmacija

Bravo aku u just wanted to ask the same question
www.farmaceuti.com
www.farmaceuti.com/tekstovi

L.G.S

Well if the search engine cannot view your topics because they are guests then I'm guessing they can't.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


bugsmi0

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

trenchteam

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.

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__);



bugsmi0

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

bugsmi0

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

Vinspire

Quote from: 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]

Whats the edit code for SMF 1.1 RC 2 ? I followed the code in page 1 but it didnt work.

Vinspire

Where is the working code for SMF 1.1 RC 2 ?  :'(

trenchteam

#157
THIS WORKED FOR ME IN 1.1RC2.  Check my sig to view my sites. Im using it in BOTH!.

Quote from: 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

Sources/BoardIndex.php, find:



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:

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.

Mayhem30

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?

trenchteam

yes.^  I think you also need to unmark access for guests in the BOARD section via the admin of your forum.

Advertisement: