Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: anidea on August 25, 2019, 06:16:00 PM

Title: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 06:16:00 PM
I'm gonna try this again.  Thanks in advance to those who attempt to put me in the right direction lol

Is there any way to create a page that resembles the forum (or possibly uses the forum) but does *not* use forum permissions, ie. is viewable to guests and the rest of the world?  Both forum members and not forum members?

Can you do this with a page that is not part of the forum?  How would you do it?

Is it possible to set a page inside of the forum visible to both members and guests?  How would you do that?

I can't seem to fix the problem I have, so I'm gonna work on creating new problems for myself lol because it's so much fun :D

Again, thank you for any attempts to set me in the right direction.  I need a serious push.  Maybe even big blinking neon lights would help, IDK at this point.  It's not a fun way to spend my Sunday.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Looking on August 25, 2019, 06:28:48 PM
Yes you can. You can use SSI, a custom page or custom code. Chose your method. ;)
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: lurkalot on August 25, 2019, 06:49:31 PM
Quote from: Looking on August 25, 2019, 06:28:48 PM
Yes you can. You can use SSI, a custom page or custom code. Chose your method. ;)

Or perhaps a Portal.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 07:02:09 PM
Quote from: Looking on August 25, 2019, 06:28:48 PM
Yes you can. You can use SSI, a custom page or custom code. Chose your method. ;)

I tried that.  But guests can only see the login page.  They cannot see the custom page.  I don't know how to fix it, and nobody can tell me how to fix it.  That's why I want to try again.

Is there a mod that does this that you prefer?  Or a particular place to get this custom page?   If so, which one/where?
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 07:02:53 PM
Quote from: lurkalot on August 25, 2019, 06:49:31 PM

Or perhaps a Portal.

I tried a portal in the past.  It was a miserable failure.  Plus, I don't need a whole portal, I just need one page to be visible.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Looking on August 25, 2019, 07:07:09 PM
Then it sounds like the issue is more than a mod... it may be some of your SMF settings or server settings
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 07:11:06 PM
Quote from: Looking on August 25, 2019, 07:07:09 PM
Then it sounds like the issue is more than a mod... it may be some of your SMF settings or server settings

But which SMF settings? 

Am I asking the wrong questions?  Or am I asking the right questions wrongly?  I'm happy to adjust, but I don't know what ya'll want.  :'( 
Edit: ookey, I get it, it's about money.  I get it, really I do, there is no free.  I just don't have any.  Thank you anyway.  All these forums are going facebookey anyway.  Why should this one be any different.  No worries, I'll stop asking until the money gods grant me money to spend.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Mick. on August 25, 2019, 07:15:55 PM
You can use a portal. Just need to know how to use it. SimplePortal mod is my fave choice.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Looking on August 25, 2019, 07:17:08 PM
Which page exactly are you trying to show guests?
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 07:27:57 PM
https://www.simplemachines.org/community/index.php?topic=569370.0

Basically, I used some template that I got somewhere here to create index.php (a home page that describes what the forum is about) that I thought would be visible to guests (and everyone) that would sit outside the smf folder but would look like the rest of smf because of the SSI reference and template reference.  I didn't realize that it never worked right because my brain didn't work right when I did it, and now that my brain is slightly better I'm trying to get back to it and make it work (like it should have all these years) but maybe my brain isn't better enough yet because this is causing a headache.  I used to be a programmer before it all went wonky, but I can't do that work anymore but I thought I might be able to figure this out because it's not exactly programming but clearly I can't.  Sorry, maybe that's too much information.  I'm gonna go take a walk.  I really do appreciate the responses though.  I'll try again later.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: lurkalot on August 25, 2019, 07:38:04 PM
Quote from: anidea on August 25, 2019, 07:02:53 PM
Quote from: lurkalot on August 25, 2019, 06:49:31 PM

Or perhaps a Portal.

I tried a portal in the past.  It was a miserable failure.  Plus, I don't need a whole portal, I just need one page to be visible.

A very quick example of using TinyPortal https://cctestsite.info/testsite2/index.php

You don't have to use the rest of the portal, but obviously you can use what you want when you want.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 08:05:36 PM
Thanks :)  I'll try again.

What I'm afraid of is that there are so many mods on this thing that what I really need to do is a fresh install, but I'm afraid of that too lol

Beautiful house panther, btw.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Illori on August 25, 2019, 08:06:46 PM
i  believe most portal mods follow SMF for permissions, so if you dont allow guests to view the forum the portal would not be visible either.

if you add $user_info to your globals, you can surround the code in an if for

$user_info['is_guest'] i believe that should make the page display for guests.

if that does not work maybe $context['user']['is_guest'] would work, you would need to add $context to your globals.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Looking on August 25, 2019, 08:15:34 PM
Try following the suggestions given by others about the portal as there are many variables to what you are saying is the issue and sometimes, from experience, the issue is not what you are seeing as the end result but something else.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: lurkalot on August 25, 2019, 08:27:38 PM
Quote from: Illori on August 25, 2019, 08:06:46 PM
i  believe most portal mods follow SMF for permissions, so if you dont allow guests to view the forum the portal would not be visible either.

if you add $user_info to your globals, you can surround the code in an if for

$user_info['is_guest'] i believe that should make the page display for guests.

if that does not work maybe $context['user']['is_guest'] would work, you would need to add $context to your globals.

I hid the boards from guests then added one front page block, and one upper block on the forum index for my example.  Obviously you can add different content / info to the front page for logged in members
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 11:31:37 PM
Fatal error: Uncaught Error: Function name must be a string in /home/public/smf/Sources/ScheduledTasks.php:1194 Stack trace: #0 /home/public/smf/Sources/Load.php(2008): loadEssentialThemeData() #1 /home/public/smf/Sources/TPortal.php(23): loadLanguage('TPortal') #2 /home/public/smf/SSI.php(67): require_once('/home/public/sm...') #3 /home/public/index.php(6): require('/home/public/sm...') #4 {main} thrown in /home/public/smf/Sources/ScheduledTasks.php on line 1194

I give up.  Long live fakebook.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Sir Osis of Liver on August 25, 2019, 11:40:14 PM
Are you just trying to add a custom landing page that guests can see, like this (http://packsearchers.com/forum/)?
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 11:50:58 PM
Quote from: Sir Osis of Liver on August 25, 2019, 11:40:14 PM
Are you just trying to add a custom landing page that guests can see, like this (http://packsearchers.com/forum/)?

EXACTLY like that!  Yes!
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Sir Osis of Liver on August 25, 2019, 11:52:41 PM
Hmm, did that years ago, will have to dig up the code to see how it's done.

Ok, basically you place your custom page in function template_kick_guest() in Login.template.php.  Instead of seeing the login window, guests see the custom page between the index template header and footer.
You have to add a header login if your theme doesn't have one, but that's easy.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 25, 2019, 11:56:40 PM
Quote from: Sir Osis of Liver on August 25, 2019, 11:52:41 PM
Hmm, did that years ago, will have to dig up the code to see how it's done.

That's exactly my problem.  I think there was either a mod or a post somewhere that I got a template, only I never did it correctly, and I've been trying to go back and fix past mistakes, only now there are no instructions.  :(  So I have the page together, but for whatever reason, guests can't see the landing page, only members can see the landing page, but members don't need to see the landing page.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Looking on August 25, 2019, 11:59:36 PM
Quote from: anidea on August 25, 2019, 11:31:37 PM
I give up.  Long live fakebook.
I don't think swearing is allowed in this community. ;)
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Aleksi "Lex" Kilpinen on August 26, 2019, 12:01:00 AM
I would think a portal would be the easiest way to do this really, I seem to remember more than one of the existing portals allowing this through their own settings.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Sir Osis of Liver on August 26, 2019, 12:06:38 AM
^ See my previous post.  There may be a mod that does this, wouldn't know.  It was a custom job.

Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 26, 2019, 12:07:51 AM
Quote from: Looking on August 25, 2019, 11:59:36 PM
Quote from: anidea on August 25, 2019, 11:31:37 PM
I give up.  Long live fakebook.
I don't think swearing is allowed in this community. ;)

Well, I didn't exactly swear.  Maybe I made an oath to a false idol?  LOL
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 26, 2019, 12:27:26 AM
Quote from: Aleksi "Lex" Kilpinen on August 26, 2019, 12:01:00 AM
I would think a portal would be the easiest way to do this really, I seem to remember more than one of the existing portals allowing this through their own settings.

I know I tried a few in the past that didn't work.  I just tried TinyPortal and that didn't work.  So if a portal is the answer, I don't know which one or how.  I think it's pretty much a lost cause, so I'm just going to let it go.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Sir Osis of Liver on August 26, 2019, 12:28:30 AM
Quote from: Sir Osis of Liver on August 25, 2019, 11:52:41 PM
Ok, basically you place your custom page in function template_kick_guest() in Login.template.php.  Instead of seeing the login window, guests see the custom page between the index template header and footer.
You have to add a header login if your theme doesn't have one, but that's easy.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: anidea on August 26, 2019, 12:33:56 AM
Quote from: Sir Osis of Liver on August 26, 2019, 12:28:30 AM
Quote from: Sir Osis of Liver on August 25, 2019, 11:52:41 PM
Ok, basically you place your custom page in function template_kick_guest() in Login.template.php.  Instead of seeing the login window, guests see the custom page between the index template header and footer.
You have to add a header login if your theme doesn't have one, but that's easy.

Thank you!  I will try that tomorrow, when my eyes are a little fresher, because that sounds like things could break pretty easily.
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Kindred on August 26, 2019, 07:26:26 AM
Quote from: Sir Osis of Liver on August 26, 2019, 12:28:30 AM
Quote from: Sir Osis of Liver on August 25, 2019, 11:52:41 PM
Ok, basically you place your custom page in function template_kick_guest() in Login.template.php.  Instead of seeing the login window, guests see the custom page between the index template header and footer.
You have to add a header login if your theme doesn't have one, but that's easy.

That is a TERRIBLE way to do what the user is asking for.
It's a messy hack, at best
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: lurkalot on August 26, 2019, 10:04:04 AM
Quote from: anidea on August 25, 2019, 11:31:37 PM
Fatal error: Uncaught Error: Function name must be a string in /home/public/smf/Sources/ScheduledTasks.php:1194 Stack trace: #0 /home/public/smf/Sources/Load.php(2008): loadEssentialThemeData() #1 /home/public/smf/Sources/TPortal.php(23): loadLanguage('TPortal') #2 /home/public/smf/SSI.php(67): require_once('/home/public/sm...') #3 /home/public/index.php(6): require('/home/public/sm...') #4 {main} thrown in /home/public/smf/Sources/ScheduledTasks.php on line 1194

I give up.  Long live fakebook.

Strange. So obviously it doesn't like the way you have your existing landing page set up, or perhaps a conflicting mod. Because out of the box TP runs fine on 2.0.15   I have reverted my test site for now. ;) 
Title: Re: How to make a page that looks like the forum but doesn't use forum permissions?
Post by: Sir Osis of Liver on August 26, 2019, 12:42:46 PM
Quote from: Kindred on August 26, 2019, 07:26:26 AM
That is a TERRIBLE way to do what the user is asking for.
It's a messy hack, at best

Actually, it's worked quite well for years.  All you're doing is replacing the login window with the custom page.  It's simple. it's neat, but like anything else in coding, if you do it wrong it breaks things.