News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF & WordPress

Started by Stixsmaster, March 31, 2007, 08:15:55 PM

Previous topic - Next topic

miCRoSCoPiC^eaRthLinG

Here's more info about my setup...

My blog is at: http://chaos-laboratory.com/ [nofollow]
SMF Installation: http://chaos-laboratory.com/forum/ [nofollow]

As for databases, I'm using two separate ones.

Not using any sub-domains.

Thanks for all the help :)
m^e
[nofollow]
 
Visit me at: Chaos Laboratory [nofollow]
Linux Counter (Get Counted) [nofollow]: Registered User - 315296

jjgallow

Hey there,

I just got back from vacation.  Thanks for all the feedback and thanks to those of you who helped others with their problems!

I don't have time to answer all the questions right now, but I will shortly.

With regards to problems with special characters, Wordpress and SMF have to have the same character encoding.

By default, SMF is ISO and Wordpress is UTF-8.  This is why I suggest your SMF be set to UTF-8.

Alternatively, you could set Wordpress to ISO.

If you're having these problems, make the character encoding the same, and you should be okay.  If you've already imported the users, you may need to:

-Deactivate the bridge in Wordpress

-Delete the imported users in Wordpress

-Reactivate the bridge

-Click on "Repair user links".  This will re-import all the users.


cheers



SebKom

Hello there!

First of all, great work and congratulations for what you have done so far! I have to admit that your plugin was one of the main reasons that made me register on the forums here. Keep it up boy!

I am having some difficulties, however. I uploaded the plugin and activated it, but I got some errors, and I couldn't even access my main page. I removed it from my FTP and now everything is fine, except that I cannot activate again (fatal error, I guess that's because I deleted it without deactivating it). Anyway, I have come up with an idea:

What if I only install the SMF_WP plugin and only let users register there? So, they register on the forums and come back at the blog main page, ready to comment with their SMF accounts! Is that possible or am I just daydreaming?

Thank you in advance for your time and congratulations once again! ;)
BuDu Creations

ExcalibursZone

Personally, I believe hosting 2 databases is a pain in the butt when everything that's in the wp_users table is in the smf_members table. The only issue is the wp_usermeta which contains other information, sort of an 'extra' storage place for custom stuff.

Anyway, I think the best bet is to slave WP to the SMF member tables except for the wp_usermeta which is WP only stuff. This would mean that you'd need only one plug-in (for WP) and nothing for SMF. You wouldn't have to copy over user accounts or anything.

There are issues, however, such as concurrent logins and the like, but I'm going to try and wade through both packages and see if I can't find a plug-in or hack for WP that eliminates the need to carry 2 user tables for the same account...

brainiac744

Excalibur: There are a few problems with that, the main one is that SMF and WP encode passwords differently. SMF uses SHA1 while WP uses MD5 (if I'm not mistaken). That COULD potentially be overcome by replacing all the references in WP or SMF, but I believe that would be a significant pain.

microscopic: Are ALL users affected by this problem, or just admins? How about accounts created after the bridge was activated, are they affected? If you have the ability can you look at your cookies and see exactly what is set when you login at both places? Do you have SMF set for subdomain independent cookies? (can't remember exactly where the setting is, and it might not apply, but it can't hurt to try it)

jjgallow

budu,

sorry to hear you're having troubles.  I cannot guarantee that it will work, but you could try.  WP_SMF can definitely run on its own...but SMF_Wordpress, probably not unless you were very lucky.

Sorry to hear that the install isn't working.  In most cases, this is because of a conflict with another Wordpress plugin.  Please let me know if this seems likely for you.

jjgallow

Hello ahrasis,

I've made a small change to SMF_Wordpress which should give you compatibility with this combination.

I have not changed the version number, but a fresh download at:
http://www.earthorbit.com/opensource

Should do the trick.  No need to re-install the WP_SMF plugin.

Let me know how it goes...

cheers  :)


Quote from: ahrasis on August 10, 2007, 11:41:56 AM
Hi jjgallow, your work is great.

However, I need some help anywhere. Have you or anyone experience mambo + smf + chat + wordpress combination? The first three work well before I try with word press. Well, I am testing the 4th combination and got this error.

QuoteNotice: Constant SMF_INTEGRATION_SETTINGS already defined in /home/content/a/h/r/ahrasis/html/forum/Sources/SMF_Wordpress.php on line 25

Fatal error: Cannot redeclare integrate_login() (previously declared in /home/content/a/h/r/ahrasis/html/components/com_smf/smf.php:589) in /home/content/a/h/r/ahrasis/html/forum/Sources/SMF_Wordpress.php on line 36

May be I shouldn't use mambo but use wordpress + smf + chat. Can anybody give me some advise?

jjgallow

Hello 3nd3r,

I am not smart enough to answer this yet, lol.  Sorry.  It is in the plans, and possibly Version 1.2 will automatically do some of this.   If you go in to the WP_SMF admin, there are some Theme Integration options which will emulate some of this, and SMF has some great SSI features that can be used.  Aside from this, I am also trying to learn how to better integrate the two.

Quote from: 3nd3r on August 16, 2007, 04:33:19 AM

Well, now for my question (hi jjgallow!  ;) ):
What I want is a way to IMPORT smf posts into WP posts, boards into categories, answers to smf posts into comments ... And so on. I meant, a complete db DUMP to definitively copy SMF Forum into Wordpress without losing any data...

Maybe a couple of SQL sentences can do this, but I don't know them  :'( Any help?

Thanks in advance foru your time.

jjgallow

Ok!

Thanks brainiac, pushkin, 3nd3r, and others who helped answer questions about this bridge.  I think everyone's question so far has been answered by me or one of you.

I will wait a bit for some feedback on how the solutions went, and then I'll release 1.1.  It will not be anything special...just a little more user friendly.  It might come with a manual override when certain users (such as admins) just refuse to link properly.

It will be the first "stable" version however, and it will be written in one language instead of two  :)

Then, on to feature integration!

cheers

ExcalibursZone

Quote from: brainiac744 on August 22, 2007, 03:22:22 PM
Excalibur: There are a few problems with that, the main one is that SMF and WP encode passwords differently. SMF uses SHA1 while WP uses MD5 (if I'm not mistaken). That COULD potentially be overcome by replacing all the references in WP or SMF, but I believe that would be a significant pain.
Nah, you'd just use the SMF stuff for any user-based info. The usermeta table doesn't have the password, just the user id. And you could replace the function that gets the user information with one that maps SMF data to the WP fields. Though, with my solution, the WP users table would go away entirely and you'd use the SMF members table exclusively. Since you're also using SMF for user authentication and whatnot, you don't have to worry about the passwords being encrypted differently. All you'd have to do is override all the functions that deal with users in WP and you *should* be golden. The trick is getting stuff to line up and getting SMF to work properly with WP. I'm looking into that though (ripping apart a CMS bridge... mambo... and seeing how they log people into SMF). If I can get that working and override all the user stuff in WP then things might just turn out well and we'd only need to use 1 plug-in.

pftq

Hey I haven't checked this in a month.  Thanks for fixing the login problem. Excellent solution too with making it dependent on the software.  I did not even consider that possibility.

Few last things - deleting users via SMF does not seem to delete for Wordpress.  Also, Wordpress names - can you not filter them? Leave them w/ numbers and punctuation.  Some users have the same name but different number - gets confusing.

jjgallow

excaliburszone,

Let me know how it goes!  Some people on here have definitely expressed a preference for that.  I would have concerns regarding the compatibility of wordpress plugins, etc.  If you're just using wordpress standalone, and you're not concerned with upgrading to future versions, you might be able to do it.   I highly doubt anyone on here just uses SMF without any plugins though, and I think you'll find that, as you use wordpress, the same holds true.

jjgallow

Hello pftq,

thanks for the feedback!

Are you using the latest version of SMF_Wordpress?  I enabled user-deletion integration from SMF fairly recently...it was one of the last things I did...due to it's destructive nature  :)

As for names and numbers...what is the character encoding set to on your Wordpress and SMF?  They should be the same...I recommend UTF-8.  If they are different, that is why you're getting character problems.

ExcalibursZone

Quote from: jjgallow on August 23, 2007, 12:27:45 PM
excaliburszone,

Let me know how it goes!  Some people on here have definitely expressed a preference for that.  I would have concerns regarding the compatibility of wordpress plugins, etc.  If you're just using wordpress standalone, and you're not concerned with upgrading to future versions, you might be able to do it.   I highly doubt anyone on here just uses SMF without any plugins though, and I think you'll find that, as you use wordpress, the same holds true.

Well, the way I plan on doing it is to override stuff by using a plug-in. You can see all the functions in wp-includes/pluggable.php.

My plan is to hide all the WP user access code (save for the usermeta table) with wrappers that fetch from the SMF members table instead. That way, for all intents and purposes, WP and all the plug-ins think that you're accessing the wp_members table when you're actually grabbing SMF.

The only compatibility issues I see with that is when other plug-ins try to do the same thing. I'm not sure what to do in that case since I haven't run into it yet... heh

The problem I face is actually logging in and staying logged in with SMF. I'm researching, and chances are, I'll be using the SMF integration hooks that the CMS bridges use.

Goals:
Login from either SMF or WP and be logged into both places.
Accessing user profiles in WP will actually access SMF except when accessing usermeta.
Reduce everything down to a single user table.

After that, adding new things in will be something else, such as when posting a blog, have it post to SMF as well... If that feature were to be used, I'd have it post to SMF directly and note in the WP tables that's where the record is located. Then use SSI or something to pull the topic and display it. I'm still working on all the ideas.

And, yeah, I'll post here and on the WP forums how it all goes.

mfapsj

#214
I tried some earlier versions of WP_SMF and also SMF_WP (up to version 06, I believe) and it worked perfectly. My site is now finished and I de-activated them, deleted the plugin/package and installed the latest versions of both plugins. User get created in SMF when registered through WP - however the staying logged in seems to have problems now. When I log in via WP and go to SMF I'm only a guest. When I login at SMF and go to WP it works! (I did clear cache etc. so that shouldn't cause the problem)

hxxp:www.marion-cotillard.org [nonactive]
hxxp:www.marion-cotillard.org/forum [nonactive]
2 separate databases

I think when I tried it out before I hadn't WPG2 (Gallery2 integration into WP, does control users via WP admin) activated, don't know whether that had any influence?

I cannot think of where to look for the origin for this problem, so, any help would greatly be appreciated!

jjgallow

Hello mfapsj,

Sorry to hear that....I have no immediate answers why it isn't working for you.

You can definitely download the older plugins on my website, although they're not listed.

For instance,

http://www.earthorbit.com/opensource/WP_SMF_1.06.zip
http://www.earthorbit.com/opensource/SMF_Wordpress_1.06.zip

Please let me know if they older version works for you...I'll give it some thought.  By chance, are there any capital letters in your username?

mfapsj

#216
I installed version 1.06 and it's working - both ways!! Great!

My username is lowercase (admin) but display name (Maria) is uppercase! Also I saw that some WP users have capital letters in their usernames.

Oh, and when I try to repair users it gives me the following:

QuoteWordPress database error: [SELECT command denied ......

*****Link Repair Complete. WP_SMF is finished with the database.*****

edit: read up on the matter. Since I can't create a second user for a database (my host doesn't have CPanel) I dropped the existing SMF tables in my WP database. Now repair works. However, 1.09 still didn't  - so I'm back with 1.06 which works perfectly fin

mfapsj

I just thought of another question. I couldn't find a similar question when I did the search, so I hope this has not been answered before.

Should I worry about spam user registrations in WP? What if I installed hxxp:fuctweb.com/2007/06/15/capcc/ [nonactive]? Would it have any influence on the plugin?

Thanks!

paki

Quick question,

Is there a "Who's Online" module in the works? I apologize if it has been asked before as I haven't had a chance to look through this yet.

Also, I am currently only running the WP_SMF bridge. (No SMF-Wordpress). When I logged out of WP, it kept me logged into SMF. Am I to assume correctly that by installing SMF_Wordpress (the SMF side of the bridge), it will log me out of SMF as well? And I can use the registration form from SMF to register a user, and they will be registered into WP?

The only reason I am using the bridge is for the SSI functions, as I haven't spent much time trying to alter files and getting it to work without a bridge.. but it sure seems like a great piece of work so far

Thanks!
http://www.dfwhyundais.com <-- Dallas/Ft. Worth's Local Hyundai Group

ExcalibursZone

#219
Update on my plug-in:

Well, in my quest to use one user table for both WP2 and SMF, I've gotten 1/2 way there! :) I ran into a question on the WP dev mailing list and came up with an idea:

What if I used an SQL view to represent the SMF member information that WP requires? Well, I had to override a few functions in a WP plug-in and make sure the view was set up properly.

Result: Using only the SMF members table, I can now log into WP without an issue! :D

There are problems, however:

  • I cannot update the view properly so I will have to find a way to override updates/inserts into the SMF database
  • WP still creates it's own cookies. Which is fine, but now duplicates data.

So, here's a list of what I'm going to attempt to do next:

  • Fix the Insert/Update features so the SMF members table is updated from WP.
  • Add code that logs the user into SMF when they log into WP.
  • Find a way for WP to use the SMF cookie instead of it's own.
  • Set up WP so that it also takes it's usermeta information from SMF as well.

Once I have all user code working properly, I will start to add new features that use SSI or smf_api to further tie the two software packages together.

Just thought I'd let you know! :)

-Ex


UPDATE:
I now have deletion working for WP->SMF, but if the user is deleted in SMF then the WP user_meta table isn't touched. Looks like I'll try to transfer the usermeta to the user table as well, that way they will both be updated quite readily.

This is showing promise, anyway, so I'm going to see what I can about inserts and updates in the user table (read as reset password, lost password, insert user, and update user). There are only a few places this happens and I might be able to do this without resorting to hacks, but wp-login and registration might have to be hacked to get this to work properly.

I will hopefully have a working plug-in for WP by Sunday night for anyone to test. Complete with install instructions.

I will say this: You need to have the basic admin account before you install the plug-in. After that, I'll fix up a way to adjust the login name of that account to match the first user in smf. Once all is said and done, there will be ONE user table for both WP2 and SMF (versions 2.2.2 and 1.1.3 respectively).

Advertisement: