Skip to main content
Topic: Wordpress Bridge (Read 9290 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Wordpress Bridge

Wordpress Bridge 1.0



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.

  • Setup this mod at Administration Center » Wordpress Bridge.
  • Logins are synchronized with your WordPress site once users log into the forum.
    • The included WP plugin will redirect users to the forum if they try to register or login to the blog site.
      • The single file elk-wp-auth.php goes into WP's plugins directory
      • It should be activated within the ElkArte site.
  • The bridge will automatically create new users to try to keep everything in sync.

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

Re: Wordpress Bridge

Reply #1

Very nice :D

Re: Wordpress Bridge

Reply #2

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
Last Edit: August 26, 2017, 03:39:05 am by goosekeeper

Re: Wordpress Bridge

Reply #3

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.
LiveGallery - Simple gallery addon for ElkArte

Re: Wordpress Bridge

Reply #4

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.

 

Re: Wordpress Bridge

Reply #5

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.

Re: Wordpress Bridge

Reply #6

Quote from: live627Wordpress Bridge 1.0

live627 could it be this done for Storify2 too?



Re: Wordpress Bridge

Reply #9

If I understand correctly their homepage, storify will be dead in few months, so seems not very useful right now...
Bugs creator.
Features destroyer.
Template killer.

Re: Wordpress Bridge

Reply #10

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

Re: Wordpress Bridge

Reply #11

The API are to interact with their servers, but if they shut down, there is no more API. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Wordpress Bridge

Reply #12

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

Re: Wordpress Bridge

Reply #13

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. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Wordpress Bridge

Reply #14

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.