Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: kaiya on February 12, 2021, 01:38:11 PM

Title: Upgrading existing integrated site to mysqli AND SMF 1 to SMF 2
Post by: kaiya on February 12, 2021, 01:38:11 PM
Apologies for long post - the code is so old and I even had to revise how to write IF statements to start editing it, which given I wrote the original by hand on Notepad (not even Notepad ++) is embarrassing. Also I may be slightly perverse but I am finding this incredibly fun so can't stop talking about it - problem solving ftw. Luckily I was apparently the queen of commenting. So, back in 2009 I set up the following:

CURRENT SETUP

Astonishingly it has run without major issues for over 12 years. However my hosting company has informed me that at the end of this month (starting 10 days from now) the server will upgrade to PHP 7.4 so I have to finally get off my butt and upgrade it. Skills-wise I am entirely self taught, I can't get my head around object oriented at all so just procedural. I have a 'dev environment' which is basically a second hosting account with the same provider (Hostgator if it matters) that is already running PHP 7.4.

PLAN

WHAT I DID (on my holidays - literally, I was off this week)

ISSUES AND SOLUTIONS (including both in case anyone else is engaging in such madness).

Issue 3 in more depth. On my old site I have SSI.php in a subdirectory (/forums) and the main site pages in public_html and no issues calling to it. I did have issues with banned members being able to access the site so is_banned etc. ran before SSI was called but I've removed that (solve that problem later) so now SSI.php is the top thing called. In my efforts this week I did get SMF 2 working with the site when they were both installed in public_html on the PHP 7.4 dev hosting but 1) the site has 140 files and 2) having to move the forums makes using my 'fixed' files straight off the bat harder work when I need to move all of this to the live site vs relative and absolute links etc. (it's a mish mash in there). I can do that if I have to, but is there an alternative?

I read elsewhere on this forum that integrated sites need now to live in the same directory as SMF 2. Is this correct? Clearly SMF 1 could run in a sub directory as I've been using it as such for 12 years... Really I just want to know: Is what I am wanting to achieve possible now?

If I've missed any details out in my rambling please ask. One issue with being self-taught is not knowing what is really important.
Title: Re: Upgrading existing integrated site to mysqli AND SMF 1 to SMF 2
Post by: Kindred on February 12, 2021, 01:50:43 PM
SMF runs just fine in a subdirectory.

SSI.php *MUST* be in the same directory as Settings.php (aka, your forum root)

You can call require_once('path/to/SSI.php'); from other directories to insert SMF content into the page -- but SSI.php itself must be in the forum root.


The OTHER site content can be in any directory or subdirectory.

here's one of my site's config

site root -- homepage, contact us, sales info static pages [uses SSI to pull in latest post]
|  |
|  +--(/product) -- online store   [uses SSI to pull in some forum content]
|
+--------(/forum) -- SMF
Title: Re: Upgrading existing integrated site to mysqli AND SMF 1 to SMF 2
Post by: kaiya on February 13, 2021, 12:04:45 PM
Brilliant, thank you. I shall persevere!