News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Integrating WP headear and footer with SMF SSI

Started by MaSSSS, December 14, 2015, 12:59:44 PM

Previous topic - Next topic

MaSSSS

Hello.

I am trying to integrate my WP with SMF and have found two articles which explain things.

http://www.ceeke.be/blog/integrate-smf-wordpress-vice-versa/

http://wiki.simplemachines.org/smf/How_do_I_integrate_SMF_into_my_PHP_coded_website

First one tells me to use

<?php
require_once('/forum/SSI.php');
?>


in WP theme headear.php and this fails with server error 500.

The other one with cooler way integration with layers tells me to use

<?php
error_reporting
(E_ALL);

$ssi_theme that pesky number again;
$ssi_layers = array('site');

// If you want SSI.php to start gzipping for you ;).
$ssi_gzip true;

require(
'forum/SSI.php');

echo 
'some stuffs go here.';

ssi_shutdown();

?>


I dont see how tese two differ but I havent tried the second one since I have no idea where to use this line of code.

Even though my hoster tells me to use include instead of require and claims that SMF is fully supported on the hosting I dont see a mod_include installed on my account if that makes any difference.

Just to note that I fully understand the difference beteen the two as described here. And I have used the corect path as in

<?php
require_once('/smf/SSI.php');
?>


I have also tried

<?php
require_once('../smf/SSI.php');
?>


Why? WP installation is in /htdocs/worpress/ and forum is in /htdocs/smf/

Have I made a mistake here or what is the problem?

I still havent done anything with this, after the error I had with the first try and am looking for some answers before I proceed.

And If I go to see ssi_examples on my site it works

http://www.armasrbija.eu.org/smf/ssi_examples.php

But if I look at the first line there it tell me to use

<?php require("/home/vol13_7/byethost7.com/b7_16972376/armasrbija.eu.org/htdocs/smf/SSI.php"); ?>

and not

<?php
require_once('/forum/SSI.php');
?>


So does this need a full physical path to work or not?

Any help and guidance is highly appreciated.

Edit: Tried the full path still nothing, error 500.

Kindred

the 500 error demonstrates a problem on the HOST side of things, with the server configuration.

The host should be able to tell you what is causing the 500 error....

personally, I always use the full path to SSI.php just to avoid confusion over relative paths
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MaSSSS

#2
I am unsure if I am doing it right...

I am ading it to the WP theme headear.php and if not logged in, it will show an SMF login page, but if I login I get error 500.

Th error from logs is

QuoteSun, 13 Dec 2015 03:46:06 -0500 Apache2::Filter::print: (32) Broken pipe at /usr/local/lib64/perl5/Apache/abuse.pm line 227Sun, 13 Dec 2015 03:46:06 -0500 Apache2::Filter::print: (500) Unknown error 500 at /usr/local/lib64/perl5/Apache/abuse.pm line 227Sun, 13 Dec 2015 06:45:27 -0500 Apache2::Filter::print: (32) Broken pipe at /usr/local/lib64/perl5/Apache/abuse.pm line 227Sun, 13 Dec 2015 06:45:37 -0500 Apache2::Filter::print: (500) Unknown error 500 at /usr/local/lib64/perl5/Apache/abuse.pm line 227 

Hosting support says everything is fine from their side but then I am making the mistake somewhere...

What I want to do is to show WP header and footer around SMF forum, and I might took a wrong step of doing it.

What I did so far is:

- added WP2SMF bridge in WP and it works, I can login to WP and auto logged in SMF
- added SMF2WP bridge in SMF so login works in both directions

What do I need to do next? Do I need SSI at all here?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MaSSSS

#4
I think that some of these two mods are making a problem. I managed just to do this:


in /forum:

index.php

add the following line above "$forum_version = '<your smf version';>"

require_once("/home/armasrbija.eu.org/htdocs/wordpress/wp-load.php");

and in /forum/Themes/<yourTheme>/

index.template.php

Look for "function template_html_above()" and add above:

require_once("/home/armasrbija.eu.org/htdocs/wordpress/wp-content/mytheme/header.php");


After this I got error 500 since I was logged into the site/forum, but nevertheless....I tried logging out of site and refreshing the forum again and voila, I got the login screen of forum with WP header above, and then I logged in at the forum and it was working. And if I do it the other way around ( login in site and go to forum ) I get error 500....

This ones a pain.... Going to try to disable the WP plugin first to see what I get...


Edit: It worked after I disabled the plugin in SMF, it was generating tons of errors and making everything load very slow. It works in the basics now but still needs lots of tweaking.

I need to remove the SMF headear/footer now and include WP footer and work on the menus....if I remove the SMF header would that remove the menu too and what about the plugins which added its settings there?

MaSSSS

I am going to scrap this idea by using these plugins. Its not working at all, random errors all over the place, and I am not capable of dealing with them.

Problem is that there is no any good bridge that I can use, which would work with this integration. If anyone has a solution please PM me or update this topic.

Westwegoman

I only use the WP2SMF bridge on the WP side and it works fine. I can switch back and forth between sites without problems. Login is done in SMF. As for the header, I had to build one to closely match the main site as I couldn't find a way to put the WP header on top of SMF cause the CSS classes would clash.

Gluz

Not only CSS classes but also some variables as SMF and WP use some with the same name and that's why integrating the header of WP in the SMF templates lead to a bunch of errors.

Your best bet is that, use only one system to Login and match the themes by edit the templates,

MaSSSS

Yeah I gave up on this, and just for the sake of anyone bumping on to this topic, dont use plugins listed in first post just use SMF2WP plugin for WP. Its outdated but works in both directions. You may get an error with Jetpack Protect, I just disabled it, I dont need that. Besides that it works without problems.

Advertisement: