Advice on integration of existing website and content to WPMUDEV with facebook plugin

Hey all, thanks for taking the time to read and respond.

My current website is a virtual pet site that used to have a lot of active members before facebook and facebook games took over the world.

I have tried so many times to integrate the site with facebook and failed so I thought I would start fresh using WPMUDEV with the facebook plugin.

As a web developer I use WP for 90% of websites I build and love it for its plugins etc so I am not new to WP but I am nowhere near an expert when it comes to the behind the scenes codes.

What I would like to do is somehow integrate my current website with the new website and am after the communities advice on the best way to go about this?

Are there any special tricks and tips for integrating databases?

If I were to create a list of default tokens, where is the best place to put these?

For example

$user_name = "$current_user->user_login";
$username = "$current_user->user_login";
$display_name = "$current_user->user_login";
$user_id = "$current_user->ID";
$userid = "$current_user->ID";
$points = "$current_user->points";
$credits = "$current_user->credit";

Any help/advice or links to useful information would be much appreciated.

I would also at some stage like to integrate the paid portions of my website with facebook credits.

  • Jack Kitterhing

    Hi there @Kerryanne

    I hope you are well today and thank you for this great question.

    How do you want to integrate the sites? Are you looking to move your whole current site across to the new one, or will one act as the virtual pet site and the other as a social hub for this? Or some other form of integration?

    If you could advise on the above and I'd be happy to give you advice :slight_smile:

    Thank you for being a WPMU DEV member!

    Kind Regards

  • Kerryanne

    Hi Jack and thanks for your response.

    Its kind of hard to explain but lets call my current site CP (chickapets dot com) and WPMU is to be used for the facebook version. (chickapets dot com/facebook)

    CP has a lot of database calls and most involve user id or username as the main identifier.

    I would like WPMU to take over the username userid login portion of the site but connect to CP database for everything else.

    This way I dont have to completely rewrite the entire site including the exhaustive admin panel of commands.

    In an ideal world, current users could access CP as usual while facebook players would access the facebook version of the site using WPMU.

    My aim is to push the facebook version.

    My issue here is duplicate user ID's and usernames.

    I hope that helps to make sense?

    I would also be open to existing members being forced to connect via facebook and have their user details merged to WPMU somehow.

  • Jack Kitterhing

    Hi there @Kerryanne

    I hope you are well today.

    Thanks for the additional information, this is quite interesting, I can see what you want to do, basically have WordPress control the Users authentication for both the facebook version and the normal version, which then means that the normal version will need to have some sort of code to connect to the WordPress versions tables and to authenticate the users.

    In some ways you could write a SQL to script to run an import for the WordPress version then delete them from the others, but then you need a way to connect the WordPress version to the main version correct?

    Thank you!

    Kind Regards

  • Kerryanne

    Hi Jack < always think of Hijack

    What you have said is pretty much spot on.

    I have so many questions and issues I don't know where to start.

    I guess for ease, I need to look at running the facebook side of the site separately and just duplicate the database tables into the WP database.

    I probably need to simplify the site for facebook anyway. Plus my php coding isnt very formal and I'm sure I have errors and bad coding practices.

    If I were to do this, how would you advise moving forward with regards to entering tokens as mentioned above. Would they all go in the header or functions?

    I am also guessing it all needs to go into the template file so that the core WP can be updated. On that note, I am using the buddy press default template in the Buddy Press plugin folder. Should I make a duplicate and use that?

  • Jack Kitterhing

    Hi there @Kerryanne

    I hope you are well today and sorry for the extreme delay with my reply.

    In this case, I would think your going to want to place your code in functions.php depending on exactly how this is going work, which tokens? Sorry I'm lost there :slight_smile:

    You would create a child theme in my opinion as that way your changes won't be overwritten, are you familiar with the WordPress API?

    Thank you!

    Kind Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.