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

Advertisement: