[wp-hackers] Re: SMF Integrator (A WordPress 2.2.2 Plugin)

Curt Woodard clwoodard at gmail.com
Mon Aug 27 14:23:17 GMT 2007


> No problem.  I've integrated the users for systems a couple of times
> in the past.
>
> How do you determine the user_id for use in wordpress?  Does SMF has a
> guaranteed unique number?  If not, can you add one?  That would
> prevent the problem of accidentally getting an ex-user's metadata.

SMF uses autoincrement for the user-id. The same way that WP does as well.

> If SMF differentiates between 'deleted' and 'deactivated', make sure
> you remove the capabilities and reset the user_level instead of
> deleting the user from the view; I'm unsure if WP will delete the
> metadata if the user is missing.  If it doesn't, then it doesn't
> matter.  But that could change in the future.

Well, SMF actually deletes the record.

What I did is check the usermeta table for user_ids that do not exist
in the view. I then delete those records. That does leave an issue
with previous posts, links, and usermeta information possibly going to
the wrong user... That will have to be fixed.

> Also note that if admin the changes the table prefix from 'wp_', it
> alters the meta_key for wp_capabilities and wp_user_level; it changes
> the wp_ to whatever the prefix is.
>
> Ciao!

Yeah, I keep that in mind when I enter info into the usermeta table. I
add the $wpdb->prefix to user_level and capabilities. That way it will
be set up properly for the blog.


More information about the wp-hackers mailing list