How To: Get SMF SSI.php Stuff to Display on your Wordpress Blog

Started by devnet, August 21, 2008, 01:05:39 PM

Previous topic - Next topic

devnet

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');
}



  • Install the plugin linked to previous in your wordpress instance.  Next, come up with what info you want to display.  For me, I wanted a login box on my sidebar.  So, I used the following code:

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




  • Replace /home/username... with your path info to SSI.php on your system.

  • You can use anything displayed on yoursite.com/forum/ssi_examples.php.  Next, add a "text" widget onto your sidebar.  Now, give it a title and paste the code you want (in my case, the code above) into the text area of the text widget.  Save.

  • Visit the front page of your blog and gasp in astonishment and wonder as the widge displays the correct login form (or whatever you wanted displayed) in the sidebar.

  • Install as many "text"/php widgets as you wish...the plugin will parse your php in each one.

  • MANDATORY STEP!!!  Now kick back, open a beverage of your choice, and marvel at your wicked awesome skills that will shock and amaze your community!

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!


devnet

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.

Rumbaar

Tips and Tricks that benefit the community with examples and specific are always welcome :)
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

cassie

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?


Rumbaar

"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Cultor

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?


dailytalk

Super!!! Wonderfull plugin!!! Many thanks to devnet! Yippee!

Cultor

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");


BumDiva

Quote from: devnet on August 21, 2008, 01:05:39 PM
You can see the stuff in action at hxxp:mypclinuxos.com [nonactive]

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.)

Rumbaar

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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

ApplianceJunk

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,






ApplianceJunk

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.

Rumbaar

If you hit ssi_example.php it should always display the correct path for SSI.php for your specific installations.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

ApplianceJunk

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?

ApplianceJunk

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?







Rumbaar

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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

NTA

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???

cassie

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

fopmhx

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

devnet

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.

solly

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 [nofollow]

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 ?


Shaliza


jrmacstudios

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

Gavin Chatt

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
Regards
Gavin Chatt
Austeam Founder
http://austeamracing.com.au

Kindred

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
Сл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."

Gavin Chatt

Regards
Gavin Chatt
Austeam Founder
http://austeamracing.com.au

internets

How can I displaying wordpress content on my smf pages ? Any help?  :-\

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."

Exo_kg

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

Kindred

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
Сл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."

becometa

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.

shinglis

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.

shinglis

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..

Gavin Chatt

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(); ?>
Regards
Gavin Chatt
Austeam Founder
http://austeamracing.com.au

JBlaze

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); ?>
Jason Clemons
Former Team Member 2009 - 2012

Gavin Chatt

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.
Regards
Gavin Chatt
Austeam Founder
http://austeamracing.com.au

Advertisement: