SSI on external page issue.

Started by spottedhog, July 10, 2010, 09:44:57 AM

Previous topic - Next topic

spottedhog

Just uploaded the latest SMF2 from the downloads.  Installed ok.  SMF is in the /forum directory.

I put a single file using SSI.php to pull in the template_header() and template_footer() in, etc. and it works fine and the menu_bar has the proper links.

Question 1:  In Version 1.1.11 and below, $context['page_title']  would show the page title in the browser bar.  Is there a new way to call this in Version 2.0?

-------------------------------------------------------------------

I have a portal/cms on the base directory and I called SSI.php the exact same way as above.  In Version 1.1.11 and before, themes and all worked perfectly.  Now, in Version 2.0 it will pull in the theme and all SSI.php functions, HOWEVER, the links are missing "/forum" so all the links go to the base location, etc.  This includes the menu_bar, links to # of PM's, links to Recent Posts; basically any link to the forum directory is missing the "/forum" in the link.  All the info pulled in by the various SSI.php functions are correct, but the links in the info pulled is missing the "/forum" part in the link.

For example, the Help Page Link should be:
http://www.912roll-call.com/forum/index.php?action=help

However it shows as:
http://www.912roll-call.com/index.php?action=help

I have tried the default theme, another "curve" theme, and the Classic theme and get the same results.

Question 2:  What am I missing in not being able to get /forum into the links?

Thank you in advance...

spottedhog

OK, I found the answer to Question #1:  $context['page_title_html_safe'] replaces -- $context['page_title'] in the index.template.php template_html_above() function.

Sooooo...  any ideas on Question #2 ???

spottedhog

I should also mention that in the Cookies and Sessions page,   Local Storage is unchecked and Independent and database sessions are checked.

xenovanis

What's the path you're using for SSI?
"Insanity: doing the same thing over and over again and expecting different results."

spottedhog

require_once("forum/SSI.php");

As I said earlier, this has worked perfectly ever since Version 1.05 I think...

Kays

If that's for a portal, I think that the language strings are added to modifications.{language}.php. Unfortunately, that file doesn't get loaded when using SSI.php. Add the following either after SSI.php is loaded or directly to SSI.php after things are loaded.


loadLanguage('modifications');

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

spottedhog

Kays....  Language strings?  This has nothing to do with Language Strings.  I am not talking about $txt['FORUM'] as that part works fine.  This has to do with ALL links generated by SSI.php functions somehow delete /forum from the link URL, thus making any of the generated links not usable since they do not go to the "forum" directory.

Kays

Then explain your problem a bit better.

Quote
Question 2:  What am I missing in not being able to get /forum into the links?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

spottedhog

SMF2 rc3 is loaded in a folder named forum.  CMS is loaded in base/home directory.  All links generated by SSI.php functions are missing /forum from each link's URL.  All links generated by the template_menu are missing /forum from each link's URL

For example,  in the links generated for the menu_bar,  the Help Page Link should be:
http://www.912roll-call.com/forum/index.php?action=help

However it shows as:
http://www.912roll-call.com/index.php?action=help

For links to Messages, also missing /forum.  For forum postings generated by the ssi_recentPosts function, the URL is missing /forum.

Base CMS link:  http://www.912roll-call.com
Base SMF link:  http://www.912roll-call.com/forum

If you go to the CMS link, you will see that SSI.php is pulling in the SMF theme properly and is displaying info pulled from SMF properly. 

This is the first time I have looked at the SMF2 code.  Could the Load.php or Subs.php files do some kind of sanitizing or something or it uses something like dirname(__FILE__) to determine the relative path for the link URL's generated by SSI.php?

I have called SSI.php from the same location in the CMS ever since SMF 1.05 or so and it has always worked.  It works just fine in SMF 1.1.x  This is the first time I have tried SMF2.

Kays

I can't reproduce this nor does it do this here. ::)

Are all of the links messed up? Have you got a link to that page or to ssi_examples.php for that forum.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

spottedhog

#10
After a good night's sleep, I thought I would review my files again.  I had the thought that the placement of where SSI.php is required might have some effect, and lo and behold YES IT DOES!

I had SSI.php required in the header.php file and for years this has worked.  I got to thinking that the index.php file is the first thing hit, so I moved it to the very top of that file and now all is working perfectly!

The previous set up I had was the require SSI.php was at the top of header.php.  In index.php it was set up like this:

require(mainfile.php)
require(header.php)

Now it is:
require(forum/SSI.php)
require(mainfile.php)
require(header.php)  <---require(SSI.php) no longer there.

Thank you for your time Kays.  I greatly appreciate any time I have wasted of yours.

...(yes, "stupid" is written on my forehead today)

thanks again...

Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: