ElkArte Community

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

Title: Wordpress Bridge
Post by: live627 on August 17, 2017, 06:04:48 am
Wordpress Bridge 1.0

(http://opensource.org/licenses/MIT) (https://github.com/live627/Wordpress-Elk/issues) (https://github.com/live627/Wordpress-Elk/releases) (https://github.com/live627/Wordpress-Elk/releases) (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, 08:43:46 am
Very nice :D
Title: Re: Wordpress Bridge
Post by: goosekeeper on August 26, 2017, 03: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, 12: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, 08:48:07 am
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, 04: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, 08:45:39 am
Quote from: live627Wordpress Bridge 1.0

live627 could it be this done for Storify2 too?
Title: Re: Wordpress Bridge
Post by: live627 on December 29, 2017, 06:56:34 pm
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 29, 2017, 09:15:35 pm
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, 04: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, 05: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, 11:57:32 am
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, 03: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, 05: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, 02: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, 01: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, 10:43:55 am
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?