MyBB Community Forums

Full Version: [Dev alert] (THe "Holy Grail") Full MyBB + Wordpress User Integration is a reality.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
##Sorry about the spelling error in the poll
Edit: mybbaddons.com has a very good option.
Some of those features are "one-way only" and this effort could be even more complete for the end-user (testing needed)
````

Good News: In the title (Full MyBB + Wordpress User Integration is a reality) , something I had working/testing until...

Bad News: A family member suffered a stroke over 3 years ago, and I have not had a life of my own for a very long time.

Great News: All the (Bare-bones) information needed to do something amazing is right here.
````

Important notes: The database layer code (creating a view) is simple, powerful and secure.
[color=#ff3366]To allow people to easily login[/color] (to Wordpress) you need to, for example, either "properly modify" the existing Wordpress logins (with a "simple" plugin [size=xx-small]// to allow wordpress to use the info in the modified db table[/size]), and/or "hack away" with something like this on the Wordpress side.
[url=https://community.mybb.com/thread-118986.html][Tutorial] EZ Fast Login | (SSO Integration) | Force Login To MyBB[/url]


[b]The Main Event[/b]
So simple, almost no PHP required (!!??!?)

1a) This SQL sample assumes your wordpress is installed using a ' mybb_wp_ ' db table prefix

1b) temporarily delete (and or backup/delete) the wordpress users table  (mybb_wp_users)

2) Now the fun part  // Showing us many coders work too d__m hard  :)




[code] -- Structure for view `mybb_wp_users`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mybb_wp_users` AS select 
`mybb_users`.`uid` AS `ID`,
`mybb_users`.`username` AS `user_login`,
`mybb_users`.`password` AS `user_pass`,
`mybb_users`.`username` AS `user_nicename`,
`mybb_users`.`email` AS `user_email`,
`mybb_users`.`website` AS `user_url`,
`mybb_users`.`regdate` AS `user_registered`,
`mybb_users`.`salt` AS `user_activation_key`,
`mybb_users`.`'_*choose _a_mybb_db_column_related _to_ranks_usergroup_anything_you_need*_'` AS `user_status`,
`mybb_users`.`username` AS `display_name`
from `mybb_users`;

````````````
^^^
works!
````````````````[/code]



Helpful tip:
The names on the left side
i.e
regdate
are related to myBB

 the names on the right side
i.e
user_registered,'
are related to wordpress.

You are making a db 'view' which creates a virtual table called 'mybb_wp_users' while all the data is actually still stored in 'mybb_users'


3) The SQL sample is over three years old, you can easily modify to fix any core changes and/or new columns created by your wordpress plugins.


Another Helpful tip:
The SQL above came from an "export" of the table.
Views are also created with code that starts like this

CREATE VIEW abc1.mybb_wp_users AS SELECT
abc1.mybb_<snip>

<snip> Easy to find more info on Google...


`````````
Last Helpful tip:
Needs testing
(for example)
Ideally users can update their email address from either MyBB or Wordpress and it works perfectly with no html link changes or additional php plugins. (No way!!)
This (and some other details) would need some help with testing.


Great News Repeated: All the (Bare-bones) information needed to do something amazing is shown above.
Please do not expect any "support" from me (this summer). I am way too busy in the real world.
Enjoy!


``````
ps. Please do not PM me about this subject before ~Jan 1st, 2019.
I am stressed and "nearly broke" from helping my family "way too much" for several years.
If you want an invite to a unique effort to make "way too much money" from the ICO Mania (Google it if needed), then please send a PM and briefly describing any skills/fun hobbies.