Advertisement:

Author Topic: How to make a page that looks like the forum but doesn't use forum permissions?  (Read 823 times)

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,371
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Yes you can. You can use SSI, a custom page or custom code. Chose your method. ;)

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Yes you can. You can use SSI, a custom page or custom code. Chose your method. ;)

Or perhaps a Portal.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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?

Offline anidea

  • Jr. Member
  • **
  • Posts: 254

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.

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,371
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Then it sounds like the issue is more than a mod... it may be some of your SMF settings or server settings

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,026
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
You can use a portal. Just need to know how to use it. SimplePortal mod is my fave choice.

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,371
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Which page exactly are you trying to show guests?

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild

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.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,280
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

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

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

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,371
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
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.

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
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

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

if that does not work maybe
Code: [Select]
$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

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,299
Are you just trying to add a custom landing page that guests can see, like this?

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
Are you just trying to add a custom landing page that guests can see, like this?

EXACTLY like that!  Yes!

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,299
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.
« Last Edit: August 26, 2019, 12:04:54 AM by Sir Osis of Liver »

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,371
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
I give up.  Long live fakebook.
I don't think swearing is allowed in this community. ;)

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,622
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
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.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,299
^ See my previous post.  There may be a mod that does this, wouldn't know.  It was a custom job.


Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,299
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.

Offline anidea

  • Jr. Member
  • **
  • Posts: 254
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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,501
  • Gender: Male
    • Kindred-999 on GitHub
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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
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. ;) 

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,299
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.