News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Integrate with wordpress (SSI)

Started by xBloodshed, July 12, 2014, 08:11:09 AM

Previous topic - Next topic

xBloodshed

Is it possible to pull SSI functions to wordpress from smf? I managed to bridge the users, but the default ssi functions doesnt work. Seems like conflict of variables or some php related errors.... testing on fresh local installs...

Kindred

Yup...   There is, strangely enough, a conflict between variables in Wordpress and smf...   No idea which specific ones...   
Сл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."

xBloodshed

Any tricks that can be done with the API?

Kindred

not really...   the problem is a variable collision...   which, in theory will continue any time ANY SMF file is called within WordPress
Сл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."

ZerK

what if you call the ssi file inside a function ? wont all the variables be declared as local variables ?

another posibility would be to include the result where you wanna show it, something like including
http://www.simplemachines.org/community/SSI.php?ssi_function=function

example:

http://www.simplemachines.org/community/SSI.php?ssi_function=recentTopics

Arantor

That's not how it works. SSI bootstraps SMF, which means all the global variables SMF declares (of which there are many) are global in scope... which means taintable by WP.

Doing it through that particular interface is strongly not recommended, assuming the host configuration even permits it (which it might not)

ZerK

i meant using  file_get_contents to get the results, i know it might now be the best way to solve it but it might work, he could also cache it for some time so he doesnt have to use file_get_contents everytime, or get it using ajax and loading it into a div.

Arantor

file_get_contents with a URL won't work on most servers.

xBloodshed

Another possible way, which I have resorted to using, is calling/displaying the posts via RSS. Not the best method, but atleast it get's the posts :(

Maybe in the next update, SMF developers can prefix smf to all global variables ($smf*****) :D

Arantor

That's not going to happen in 2.1 because of the sheer number of things to change, not to mention the extremely vast potential for bugs to creep in.

This is the sort of thing that a 3.0 would be needed for, a ground up rewrite from scratch.

Stealth01

Quote from: xBloodshed on July 12, 2014, 08:11:09 AM
Is it possible to pull SSI functions to wordpress from smf? I managed to bridge the users, but the default ssi functions doesnt work. Seems like conflict of variables or some php related errors.... testing on fresh local installs...

I'm interested as to how your idea is going to work out -we have a separate smf forum from our mainsite based on wp. Hopefully we can work on integrating wp

Kootch

Hey there.

Has anyone found a way for this to work?  I want to put a couple ssi calls into my wordpress website.

My site is http://tmlfans.ca and my forum is http://tmlfans.ca/community

This is in my home.php file:  <?php require("/home/tmlfans/public_html/community/SSI.php"); ?>

and this is in my wordpress sidebar:  <?php ssi_topTopicsReplies(); ?>

Anyone?

Advertisement: