ElkArte Community

Extending Elk => Addons => Topic started by: live627 on August 17, 2017, 12:04:48 pm

Title: Wordpress Bridge
Post by: live627 on August 17, 2017, 12:04:48 pm
Wordpress Bridge 1.0

(https://camo.githubusercontent.com/d7b0ca6383644d5ac81e234f8d2249b731a1407b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3030393939392e737667) (http://opensource.org/licenses/MIT) (https://camo.githubusercontent.com/0b243acc7047d63de5fc3739732191a51b017903/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c6976653632372f576f726470726573732d456c6b2e737667) (https://github.com/live627/Wordpress-Elk/issues) (https://camo.githubusercontent.com/45d5631657e3c0c13e71c4d59cbd7b21ba30ff48/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c6976653632372f576f726470726573732d456c6b2e737667) (https://github.com/live627/Wordpress-Elk/releases) (https://camo.githubusercontent.com/a49b7dcd58132b002b86b03d03eb668c75c12bb2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6c6976653632372f576f726470726573732d456c6b2f746f74616c2e737667) (https://github.com/live627/Wordpress-Elk/releases) (https://camo.githubusercontent.com/42369538c2c9e329a15d33929bcc9a2172dee3c4/68747470733a2f2f737570706f727465722e3630646576732e636f6d2f6170692f622f61786c736a316f386f30616d65706672723565716c636a7a61) (https://supporter.60devs.com/give/axlsj1o8o0amepfrr5eqlcjza)

Bridge logins between WordPress and ElkArte.

Introduction:

This will synchronize logins between WordPress and ElkArte. This applies to all accounts on both the forum and the blog.


Note that there is a conflict because both ElkArte and WordPress try to load the same password library into the same namespace. This can easily be remedied by adding a small code snippet.

In ./wp-includes/class-phpass.php, find
Code: [Select]
class PasswordHash {
and replace it with the following
Code: [Select]
if (class_exists('PasswordHash')) return;
class PasswordHash {

I recommend doing this before installing the bridge, to avoid said conflict if you forget this later. It simply checks if the class is already loaded, and skips loading if it's already in memory.

Requires PHP 5.4 or newer to run

Ask about any questions and please donate if you can.

https://github.com/live627/Wordpress-Elk/releases
Title: Re: Wordpress Bridge
Post by: Spuds on August 17, 2017, 02:43:46 pm
Very nice :D
Title: Re: Wordpress Bridge
Post by: goosekeeper on August 26, 2017, 09:18:44 am
I have attempted to test this (with my novice skillset) as its been something I've very exited to be able to implement in a live setting.  However, with multiple attempts I receive the following error 100% of the time when trying to log out of WP after activating the plugin.

If anyone has been able to get this to work your advice would be greatly appreciated.

Error:
Fatal error: Uncaught exception 'Exception' with message 'safe_unserialize: unknown/malformed type: [' in /home/msbsimco/public_html/forum/sources/ext/serialize.php:165 Stack trace: #0 /home/msbsimco/public_html/forum/sources/ext/serialize.php(281): ElkArte\ext\upgradephp\_safe_unserialize('[1,\\"ccec1b163c...') #1 /home/msbsimco/public_html/forum/sources/subs/Util.class.php(590): ElkArte\ext\upgradephp\safe_unserialize('[1,\\"ccec1b163c...', Array) #2 /home/msbsimco/public_html/forum/sources/Load.php(3186): Util::unserialize('[1,\\"ccec1b163c...') #3 /home/msbsimco/public_html/forum/sources/Load.php(185): serializeToJson('[1,\\"ccec1b163c...', Object(Closure)) #4 /home/msbsimco/public_html/forum/SSI.php(174): loadUserSettings() #5 /home/msbsimco/public_html/wp-content/plugins/elk-wp-auth.php(23): require('/home/msbsimco/...') #6 [internal function]: {closure}('') #7 /home/msbsimco/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array(Object(Closure), Array) #8 /home/msbsimco/public_html/wp-includes/class-w in /home/msbsimco/public_html/forum/sources/ext/serialize.php on line 165
Title: Re: Wordpress Bridge
Post by: live627 on August 28, 2017, 06:02:54 am
That error is seen only when logging out WP, the forum, or both? Elk 1.0? I can't reproduce any error...

@Spuds any thoughts? I see some weird code paths from Elk in that bug report and I need help.
Title: Re: Wordpress Bridge
Post by: Spuds on August 28, 2017, 02:48:07 pm
It appears to be tossing the exception during the processing of ElkArtes default cookie ...  right before a setLoginCookie.  I wonder if the the cookie is somehow corrupt as unserialize (the special version used for < php 7) is saying its invalid.
Title: Re: Wordpress Bridge
Post by: goosekeeper on August 28, 2017, 10:39:13 pm
The error is when logging out of WP. ElkArte 1.0.10, but I am unable to try logging in for obvious reason.

The Elkarte login/logout does not seem to be impacted.
Title: Re: Wordpress Bridge
Post by: omBre on December 29, 2017, 02:45:39 pm
Quote from: live627
Wordpress Bridge 1.0

live627 could it be this done for Storify2 too?
Title: Re: Wordpress Bridge
Post by: live627 on December 30, 2017, 12:56:34 am
is that some live service? What is the url? I found http://answers.livefyre.com/product/storify-2/ but that might not be it...
Title: Re: Wordpress Bridge
Post by: omBre on December 30, 2017, 03:15:35 am
Yes, extra intuitive blogging platform for sure, but apparently next spring will wanish

Yet, its clever to use their blogging platform v.1 https://storify.com for ElkArte blogs
https://www.youtube.com/watch?v=D9hrMi-Nigo

here is somekind of echo from it https://github.com/azat-co/sfy-gallery
Title: Re: Wordpress Bridge
Post by: emanuele on December 30, 2017, 10:20:22 am
If I understand correctly their homepage, storify will be dead in few months, so seems not very useful right now...
Title: Re: Wordpress Bridge
Post by: omBre on December 30, 2017, 11:05:42 am
Yes the room for bridging is gone, but hope if we could find the original API from their previous version that was available earlier, we could integrate it here as bloging platform, believe me bloging on storify was something out of this world expirience ... i'll try to contact this man if has the original api code https://github.com/azat-co/sfy-gallery
Title: Re: Wordpress Bridge
Post by: emanuele on December 30, 2017, 05:57:32 pm
The API are to interact with their servers, but if they shut down, there is no more API. ;)
Title: Re: Wordpress Bridge
Post by: omBre on December 31, 2017, 09:00:12 am
I meant to use that storify engine as our blog platform, architecture that is easy and attractive in same time ... its node.js but as I see it could be integrated in the php architecture of the forum

https://entwickler.de/webandphp/integrating-node-js-with-php-125830.html
Title: Re: Wordpress Bridge
Post by: emanuele on December 31, 2017, 11:54:16 am
Unless I'm blind (and it could very well be I missed it), what they provide/d is/was a service (i.e. they allowed people to use their tools from their website), I can't see any trace of the code of the tools (i.e. the blogging software), so no integration available.
The only code they provided are at:
https://github.com/storify
that include a series of examples in different languages to interact with their services through their APIs.
The only standalone project is:
https://github.com/storify/iscrolldnd (that is nice indeed, but still has nothing to do with blogging).
The node.js example you linked before is just a node.js example of how to use storify APIs.
But since the site is going down, there will be no API to interact with and so no possible integration. ;)
Title: Re: Wordpress Bridge
Post by: hartiberlin on January 24, 2018, 08:17:01 pm
I am still pondering, if I should use SimplePortal or this Wordpress Bridge as my Portal...

Hmm, I can put the URL of Elkarte Forum onto one Menu Icon in Wordpress, but how can I add
an Icon Tab ( Menu Icon) in Elkarte to link back to the Wordpress section ?

Many thanks in advance.
Title: Re: Wordpress Bridge
Post by: Jorin on January 25, 2018, 07:13:04 am
You have to edit /sources/Subs.php. The menu can be find there.
Title: Re: Wordpress Bridge
Post by: lordmortimer on February 20, 2020, 04:43:55 pm
Hello, people!

I think it's time for me to give this a try. If I understood correctly, my current Elk users will be logged into WP the moment they make the next login after install, right? What about users that are always logged in? Do they have to logout and login again to make it work?