Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Biology Forums on June 18, 2018, 08:14:16 PM

Title: Easiest way to make a custom home page
Post by: Biology Forums on June 18, 2018, 08:14:16 PM
What's the easiest what to make a custom home page without the use of portals?

Is it index.php that controls this?

Of course I'd like to use the header and footer of the website.

In other words, if you access https://url.com, it goes to the custom page rather than boardindex.

Thanks
Title: Re: Easiest way to make a custom home page
Post by: SMFHacks.com Team on June 18, 2018, 08:25:35 PM
In index.php where it says require BoardIndex.php replace with your own file.

Then make an action such as action=forum and have that redirect to the forum page. That's something what I do with my portal mod ezportal similar concept.
Title: Re: Easiest way to make a custom home page
Post by: Kindred on June 18, 2018, 09:05:14 PM
https://custom.simplemachines.org/mods/index.php?mod=2915


but why?   Why are you opposed to using a portal?  A portal can do as much or as little as you like (including JUST handling the home page)
Title: Re: Easiest way to make a custom home page
Post by: Biology Forums on June 18, 2018, 09:11:36 PM
Too bloated, want to keep it simple.

Even the mod above, why would I add all that extra functionality when all I need is a homepage?
Title: Re: Easiest way to make a custom home page
Post by: Sir Osis of Liver on June 18, 2018, 10:57:55 PM
Hmm, I vaguely recall doing something like that for a forum 4-5 years ago.  Let's see ....

Ok, it was here (http://www.packsearchers.com).  If guest access is disallowed, unlogged visitors see home page, logged members go directly to forum.  Code for home page is in function template_kick_guest() in Login.template.php.  It basically replaces the login screen guests see when guest access is disabled.

Title: Re: Easiest way to make a custom home page
Post by: Biology Forums on June 18, 2018, 11:09:02 PM
that's an excellent idea... home page only for guests

thanks