Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: devnet on August 21, 2008, 01:05:39 PM

Title: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: devnet on August 21, 2008, 01:05:39 PM
What this isn't
So there is a lot of discussion about a bridge between WP and SMF.  This isn't it.  It has nothing to do with any bridging.  I just wanted a way for my users to visit the front page of my blog and login to get to the forum...maybe see some stats and posts...that's it.  So this isn't a way to get your userbase bridged.

What this IS

This is a way for you to get information that is provided by SSI.php onto your wordpress front page.  This includes a login box and anything else you want to parse onto it.  You can even create a static page on your wordpress blog and display the entire contents of ssi_examples.php if you'd like.  This gives you the ultimate control over what you want to disply.  Just remember that not every wordpress template will display things correctly for you ;) so you may have to do some CSS foo.

Information:
I have my forum in /home/username/public_html/forum
I have my blog in /home/username/public_html/

SMF Version 1.1.5
Wordpress 2.6.1

What you Need
Wordpress Plugin:  ExecPHP -> http://bluesome.net/post/2005/08/18/50/
Plugin Version I used is 4.8

How to Do It

// Grudge chickens out and puts this in for combatibility. This will be ripped out on day one for SMF 1.2 though ;)
function is_admin()
{
   isAllowedTo('admin_forum');
}



<?php require("/home/username/public_html/forum/SSI.php");
ssi_login();
?>


Hope this helps someone...I've spent a good part of 3 days reading posts that didn't help me and finding out that everyone pretty much installs the bridge.  Bridges burn, break, collapse, and crumble.  I don't like using them.  So I hope people find this information just what they need!   8)

You can see the stuff in action at http://mypclinuxos.com

No live site up for this anymore....

Enjoy!
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: karlbenson on August 21, 2008, 02:08:11 PM
http://www.simplemachines.org/community/ssi_examples.php
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: devnet on August 21, 2008, 02:22:17 PM
Just posted this example for specifics...there seems to be a lot of questions about how to do it with wordpress.  Sorry if that didn't come through or insinuated that ssi_examples here wasn't good enough.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Rumbaar on September 17, 2008, 07:25:37 AM
Tips and Tricks that benefit the community with examples and specific are always welcome :)
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: cassie on December 11, 2008, 03:34:06 PM
devnet...THANK YOU! This is exactly what I was looking for.

Now...one question. Is there a way to make the recent posts listing, which is rather wide, fit in to a narrower sidebar area?  I can't seem to find the right solution via CSS. Can you point me in the right direction?

Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Rumbaar on December 11, 2008, 03:48:23 PM
Passing information into an array and handling SSI, these threads might help
SSI Readme (http://docs.simplemachines.org/index.php?topic=400)
[README] SSI FAQ\'s (http://www.simplemachines.org/community/index.php?topic=14906.0)
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Cultor on December 27, 2008, 09:45:50 AM
Thanks a lot for explaning that. It makes wordpress and smf a great combination and ready for the future.

But I get this error in IE and sometimes in FF too:
SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! /usr/home .... On line 166
Any clues what is going on?

Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: dailytalk on December 27, 2008, 12:28:50 PM
Super!!! Wonderfull plugin!!! Many thanks to devnet! Yippee!
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Cultor on December 27, 2008, 04:34:31 PM
Okey found out what went wrong.

If you get the SSI.php was unable to load a session! error.

Place this code in the first row of your wordpress template index.php

<?php require_once("/home/username/public_html/forum/SSI.php");

Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: BumDiva on January 06, 2009, 04:49:30 AM
Quote from: devnet on August 21, 2008, 01:05:39 PM
You can see the stuff in action at http://mypclinuxos.com

I love how the forum on this site has the same layout as the WordPress site. This is what I've been trying to do on my website. I've done searches but found a lot of posts about a bridge, I don't care to have a bridge, just want the forum to fit in the site. How did you do this? (Or if anyone else can point me in the right direction I would appreciate it.)
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Rumbaar on January 06, 2009, 03:55:09 PM
That is just a SMF theme that has been created to look like the main WordPress site.  You can try and get a theme from the Customize section to look similar to your or modify one to meet your needs.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: ApplianceJunk on January 06, 2009, 05:10:20 PM
sOh, I would love to get this working on our blog, but I'm having some trouble.

We have our forum at public_html/forums and our blog at public_html/blog

Install wordpress plug in ok.

Found and removed:
// Grudge chickens out and puts this in for combatibility. This will be ripped out on day one for SMF 1.2 though ;)
function is_admin()
{
   isAllowedTo('admin_forum');
}


Added this to blog text box in side bar.

<?php require("/home/username/public_html/forum/SSI.php");
ssi_login();
?>


I edited it to this.

<?php require("/home/public_html/forums/SSI.php");
ssi_login();
?>


and it did not work so I tried this.

<?php require("/public_html/forums/SSI.php");
ssi_login();
?>


Still did not work and I get this type of stuff showing up in the blog text box on the side bar.

QuoteWarning: require(/home/public_html/forums/SSI.php) [function.require]: failed to open stream: No such file or directory in /home/applianc/public_html/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 1

Fatal error: require() [function.require]: Failed opening required '/home/public_html/forums/SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/applianc/public_html/blog/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 1

Guess to start with I'm not sure if I edit the path to our forum SSI.php correctly.

Can someone tell me what I'm doing wrong?

Thanks,





Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: ApplianceJunk on January 06, 2009, 05:18:04 PM
Is username my cpanel/ftp username?

<?php require("/home/username/public_html/forum/SSI.php");
ssi_login();
?>


If so I edited to include my username like this

<?php require("/home/appliance/public_html/forums/SSI.php");
ssi_login();
?>


Now I don't get any error in the blog text box, but I don't get any login info either.
Just the title of the blog text box shows up.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Rumbaar on January 06, 2009, 07:43:05 PM
If you hit ssi_example.php it should always display the correct path for SSI.php for your specific installations.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: ApplianceJunk on January 07, 2009, 08:09:29 AM
Quote from: Rumbaar on January 06, 2009, 07:43:05 PM
If you hit ssi_example.php it should always display the correct path for SSI.php for your specific installations.

Sorry, but I just don't understand.

What do you mean, hit ssi_example.php?
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: ApplianceJunk on January 07, 2009, 09:21:52 AM
Quote from: Rumbaar on January 06, 2009, 07:43:05 PM
If you hit ssi_example.php it should always display the correct path for SSI.php for your specific installations.

Ok, now I'm starting to understand.

I go here,

http://appliancejunk.com/forums/ssi_examples.php

And see examples.

Such as

Top Boards Function: <?php ssi_topBoards(); ?>

and below that it shows the what the ssi_topBoards look like.

I then put this in a wordpress side bar text box.

<?php require("/home/applianc/public_html/forums/SSI.php");
ssi_topBoards();
?>


and it then shows my forums top boards in the side bar of my wordpress blog!

Yes, that part works great!

So back to the log in part.

I look at my SSI_example page and it has this.

Login Function: <?php ssi_login(); ?>

but there is no example of what it looks like, it's blank.

And I think that is way I get a blank wordpress text side bar when I put this code in.

<?php require("/home/applianc/public_html/forums/SSI.php");
ssi_login();
?>

Why is my ssi login coming up blank?

Does it have anything to do with using TP or custom work I have done to our theme?






Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Rumbaar on January 07, 2009, 03:44:43 PM
It's based on your current status, so if you are NOT logged into the forum and visit the example it will show you the login prompt.  Otherwise it shows you your logged in details for other access.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: NTA on February 09, 2009, 10:27:19 PM
Quote// Grudge chickens out and puts this in for combatibility. This will be ripped out on day one for SMF 1.2 though ;)function is_admin(){   isAllowedTo('admin_forum');}
Could this modification in SMF cause a securities problem???
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: cassie on March 25, 2009, 12:37:37 PM
appliancejunk...go get a plugin on wordpress.org that allows you to use php in text widgets. That will solve your problem.

I still can't figure out how to resize the display generated. I'm sure I need to add some code in the call of the function but I can't find anything in the documentation for SSI. I can't alter it with css.

Can someone help me? I'm putting it in a sidebar and I want to be able to narrow the width of the output
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: fopmhx on January 22, 2010, 01:32:21 PM
Apologies for dredging such an old topic up, but it seems a better option than starting a new topic.

I've followed all the steps indicated above, but now have the error message:
Parse error: syntax error, unexpected T_IF in /home/innersen/public_html/*****/forum/Sources/Security.php on line 1

However line 1 od security.php is:
<?php

any advice would be greatly appreciated
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: devnet on January 22, 2010, 01:42:45 PM
Quote from: fopmhx on January 22, 2010, 01:32:21 PM
Apologies for dredging such an old topic up, but it seems a better option than starting a new topic.

I've followed all the steps indicated above, but now have the error message:
Parse error: syntax error, unexpected T_IF in /home/innersen/public_html/*****/forum/Sources/Security.php on line 1

However line 1 od security.php is:
<?php

any advice would be greatly appreciated


You're either missing a semicolon or a close parenthesis in an expression in security.php.

My advice is to download a fresh copy of SMF and compare your file and the fresh file for differences.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: solly on March 24, 2010, 08:25:40 PM
How do i go about reversing this method and displaying wordpress content on my smf pages ?

Bassically i have a global header which is built in the smf template and that header needs to display content from wordpress.

I have followed this method - http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website

How ever i get this message when trying to use wordpress code

Fatal error: Call to undefined function wp_list_bookmarks() in C:\xampp\htdocs\forum\Sources\Load.php(1726) : eval()'d code on line 313

Has any body else run into this error before ?

Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Shaliza on March 30, 2010, 09:11:47 PM
Anyone know if this works for 2.0?
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: jrmacstudios on May 17, 2011, 07:41:12 PM
I don't mean to drudge this up either, but I followed some of the same directions here hoping it to work and I get
QuoteFatal error: Call to undefined function allowedto() in /data/25/2/161/113/2487765/user/2724405/htdocs/forums/Sources/Load.php on line 1137
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Gavin Chatt on March 05, 2014, 12:53:19 AM
Sry Admin,trying to search however this is the closest I've found.



Where do I add this, I've tried the first line on the header page but it fails when I try and use it, tried a few other locations as well but still the same issue. I've following the following from the http://www.simplemachines.org/community/ssi_examples.php

QuoteInclude Code

To use SSI.php in your page add at the very top of your page before the <html> tag on line 1 of your php file:
Code: [Select]
<?php require("SSI.php"); ?>

I've then gone to my WordPress theme and located the header page and tried to add in line one but as mentioned my site dies.

Header (header.php)
Quote<?php global $theme; ?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php $theme->meta_title(); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<?php $theme->hook('meta'); ?>
<link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/reset.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/defaults.css" type="text/css" media="screen, projection" />
<!--[if lt IE 8]><link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/ie.css" type="text/css" media="screen, projection" /><![endif]-->

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, projection" />

<?php if ( is_singular() ) { wp_enqueue_script( 'comment-reply' ); } ?>
<?php  wp_head(); ?>
<?php $theme->hook('head'); ?>

</head>

All I'm hoping to do is add the calendar "events" to the Wordpress front page.

Wordpress sits at http://mydomain.com
SMF sits at http://mydomain.com/forums
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Kindred on March 06, 2014, 08:08:38 PM
IIRC, WordPress and SMF have some conflicting variable names -- so loading SSI within wordpress is an iffy proposition...

but you would add the SSI declaration and the function call within a php block/widget
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Gavin Chatt on August 05, 2014, 09:55:26 PM
Thanks Kindred
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: internets on August 13, 2014, 10:35:47 AM
How can I displaying wordpress content on my smf pages ? Any help?  :-\
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Kindred on August 13, 2014, 06:26:16 PM
Use an RSS feed in one of your smf portal blocks
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Exo_kg on August 18, 2014, 03:32:29 PM
Quote from: Kindred on March 06, 2014, 08:08:38 PM
but you would add the SSI declaration and the function call within a php block/widget

Could you suggest how to do it? I need edit SSI.php or only my php code in widget? Thanks
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Kindred on August 18, 2014, 05:57:43 PM
well, I have already stated that it is an iffy proposition to begin with.

If you don't even know how SSI works, then I suggest not trying it until you have a better understanding of coding....

The first place you can start looking is in our very own WIKI/FAQ on how to use SSI.php
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: becometa on August 20, 2014, 07:03:58 PM
Quote from: Kindred on August 18, 2014, 05:57:43 PM
well, I have already stated that it is an iffy proposition to begin with.

If you don't even know how SSI works, then I suggest not trying it until you have a better understanding of coding....

The first place you can start looking is in our very own WIKI/FAQ on how to use SSI.php

So what steps are necessary to get it to work?
I don't mind that it would be an iffy thing to do. I as well as others just need the SSI inside wordpress.
Why should i limit myself and suffer using simpleportal/ezportal and such where I can have great CMS which WP definitely is connected with great forum software which SMF definitely is.

I've tested the steps that OP have suggested and on localhost environment for some unspecified amount of time IT WAS WORKING. Now it does not.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: shinglis on May 20, 2015, 11:47:25 AM
Just to add I found this very useful and got working very quickly except the Wordpress plugin mentioned is no longer available.
QuoteWhat you Need
Wordpress Plugin:  ExecPHP ->
Plugin Version I used is 4.8

But I used this one instead :
PHP code Widget


Taken a few days effort reading all the forums / searching but happy to get resolved and can get on with some integration.
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: shinglis on May 21, 2015, 08:31:14 AM
QuoteJust to add I found this very useful and got working very quickly except the Wordpress plugin mentioned is no longer available.
Quote
What you Need
Wordpress Plugin:  ExecPHP ->
Plugin Version I used is 4.8

But I used this one instead :
PHP code Widget


Taken a few days effort reading all the forums / searching but happy to get resolved and can get on with some integration.

Right forget all that now found a version called : Shortcode Exec PHP;
which enable code to insert in posts, pages, widgets; just about anyway on your wordpress site.
added the require statement to header.php and everything great..
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Gavin Chatt on August 12, 2015, 12:57:37 AM
Got this working on my site and love it however I'm not smart enough to know how to code and was hoping someone might know what I need to use to have upcom'n events show for a set period for example, maybe the next 30 days for example.

Right now I'm using Todays Events
<?php ssi_todaysEvents(); ?>
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: JBlaze on August 12, 2015, 03:22:36 AM
You can use ssi_recentEvents() which will show x number of upcoming events. There's no way to do a custom date range without modifying the function and queries.

Show the next 15 upcoming events:
<?php ssi_recentEvents(15); ?>
Title: Re: How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog
Post by: Gavin Chatt on August 12, 2015, 04:05:51 AM
Hi zilladotexe  :)

Have added that to the site but still not seeing it show up, also tried a (+15) just in case beeding to look forward but no joys, thanks tho.