News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF & WordPress

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

Previous topic - Next topic

jjgallow

Awesome haymann,

I'm really glad to hear it's working!

Hopefully this becomes a trend...I really feel that the plugin is stable for most users now.   I realize previous versions would sometimes make mistakes with the admin accounts, however I think I've solved this with the latest available download.  Feel free to PM me if you have any more trouble with your admin account...there is a fix for it.

cheers  :)

antracit

 :) Hi

This is great work realy! Tested it and it was ok (exept for some charecters), I'm not on UTF-8 and can not change without other problems.

Is it possible to run this with a database on other charset?

//johan

jjgallow

Hello antracit,

I've thought about it...I know almost ZERO about the subject.  I honestly have never pursued it as I'm a pretty strong supporter of UTF-8 myself.  To be fair, I will look into this.

For starters though...you'd need to have Wordpress in a non-UTF format...and it's not easy:
http://codex.wordpress.org/Converting_Database_Character_Sets


....Unless I could find a way to convert the character set each and every time information runs through the bridge.  I'm a little scared of that, but will have a look at this also.

p.s...If you really bug me about it...I might be able to figure out something  :)

Maybe PM me with exactly what kind of problems you end up having?  That might help me find a simple solution...if there is one.

joewen7

Hi jjgallow. I'm getting this error at the moment when I'm at the plugins > SMF page, with version 1.0.9.

"Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /path to my server/public_html/wp-content/plugins/WP_SMF/smf_api_1.1.php on line 179
WordPress database error: [Incorrect table name 'members']
SELECT ID_MEMBER, memberName, passwd, emailAddress, personalText, websiteUrl, aim, yim, realName from ``.members ORDER BY ID_MEMBER"

I'm testing it on a test site, not my main. It was working when I was testing out version 1.0.6, with my old database. But before I used 1.0.9, I uploaded the latest database of my main site onto the test site (since it grew).

Do you have any idea what is causing this error? Thanks for you time.

jjgallow

Hello joewen7,

It appears that this has more to do with your database change than the version change

(I sure hope so, anyway!)

What this error means, is that the plugin cannot find the name of your database.  Now, normally it would get this information from Settings.php in your SMF folder.  So:

Is the path set wrong in Plugins->SMF?

Does $db_name in Settings.php refer to the correct database name in SMF?  I'm guessing that this is somehow empty, or doesn't have the name of your test database in it.

Hope this helps...let me know how it goes!


pftq

#165
Hi, I've had a few complain of the lowercase naming in Wordpress.  I understand you say it doesn't work well with uppercase, however I've taken a look at the mysql tables for it.

It seems like the uppercase work fine in Wordpress - except that only the user_nicename field must be lowercase.  Do you think you can configure the plugin to only convert to lowercase for the user_nicename?

You're missing in wp_smf.php:
...
///////// Insert SMF user into Wordpress
$user_login=$smfuser->memberName;
$user_nicename=strtolower($user_login);

...
$userdata = compact('user_login', 'user_email', 'user_pass', 'description', 'user_url', 'aim', 'yim', 'first_name', 'last_name', 'user_nicename');

I'm not sure where to edit your code to stop it from converting all login to lowercase though (don't want to break where it might actually need to be lowercase)

jjgallow

Hello pftq,

I will look at this tonight and change the code if this is the case.

I'll re-post a reply at that time.

cheers  :)

pftq

#167
I just went through to change it myself.  Have to say it's working great (what I did was remove all strtolower and add the code I put in bold above for that one file; leave the smf_api untouched though).  The user_login remains the same as SMF (the casing) and the user_nicename correctly goes to lowercase.

I found one problem though and I'm not sure if it's my editing or not.  When deleting a member from Wordpress, it deletes from SMF - but the total members count for SMF does not decrease...

ChemEng1

#168
Quote from: jjgallow on August 01, 2007, 11:51:48 PM
Hello joewen7,

It appears that this has more to do with your database change than the version change

(I sure hope so, anyway!)

What this error means, is that the plugin cannot find the name of your database.  Now, normally it would get this information from Settings.php in your SMF folder.  So:

Is the path set wrong in Plugins->SMF?

Does $db_name in Settings.php refer to the correct database name in SMF?  I'm guessing that this is somehow empty, or doesn't have the name of your test database in it.

Hope this helps...let me know how it goes!



Alright, I used this address and it connected: /home/content/c/h/e/chemeng/html/mb

Yippee!!!

I can see that all my WP users have been ported over to my SMF forums. Very cool.

If I log-in to my WP, should it recognize that when I go into my SMF boards? Or will I need to log in again on the boards?

jjgallow

Hello ChemEng,

It should recognize it...I'm confused...are you joewen, or is this a different situation?

Anyway glad it's worked.  Let me know if you have any login troubles.

cheers

jjgallow

Hello pftq,

First of all, let me say that I really like your site integration!  Very impressive.

I've looked into the code, and you are right that Wordpress can have users with uppercase.

However, WPMU (Wordpress MultiUser) cannot, and I don't want to lose compatibility with this.

Now, I would consider allowing users to have upper-case specifically with Wordpress, but here's the problem:

Try logging in using lower-case.  If you have an upper-case username, I think you'll find it won't let you.

My opinion is that this will be confusing for many SMF users, as SimpleMachines handles these logins much better.  Because SMF users are used to being able to log in with upper OR lower case, I think it may be best to not have Wordpress users with upper case.

Please let me know what you think of these reasons.  It would be very easy for me to change this code, but I think it would lead to more problems.

Maybe....in the future, I would consider making this an OPTION in admin...so each webmaster can decide for themselves.  ....would this be a good idea?

cheers  :)

Quote from: pftq on August 02, 2007, 03:39:03 PM
Hi, I've had a few complain of the lowercase naming in Wordpress.  I understand you say it doesn't work well with uppercase, however I've taken a look at the mysql tables for it.

It seems like the uppercase work fine in Wordpress - except that only the user_nicename field must be lowercase.  Do you think you can configure the plugin to only convert to lowercase for the user_nicename?

You're missing in wp_smf.php:
...
///////// Insert SMF user into Wordpress
$user_login=$smfuser->memberName;
$user_nicename=strtolower($user_login);

...
$userdata = compact('user_login', 'user_email', 'user_pass', 'description', 'user_url', 'aim', 'yim', 'first_name', 'last_name', 'user_nicename');

I'm not sure where to edit your code to stop it from converting all login to lowercase though (don't want to break where it might actually need to be lowercase)

pftq

Thanks - it took me a while now I think lol.

Options are always best. I was not aware of WPMU that this was designed for.  However, a number of people will indeed only have Wordpress and SMF.

Wordpress being case-sensitive for logins shouldn't be too much of a problem... I personally think it's more confusing to remember two logins (one lowercase and one regular), supposing I had upper case letters in my screenname. :P

For setting it to an option, the best approach would probably be to replace strtolower with a function, checking if the option is enabled before setting the username to lowercase.

ChemEng1

Im d
Quote from: jjgallow on August 02, 2007, 11:36:49 PM
Hello ChemEng,

It should recognize it...I'm confused...are you joewen, or is this a different situation?

Anyway glad it's worked.  Let me know if you have any login troubles.

cheers

Sorry for the confusion. Im different than joewen, although we shared the same problem.

I am still having problems with having to log in twice though.

I start with logging out of both my WP and SMF. Then I log into WP and hit the link to my SMF. It still wants my user information.

The same is true if I start with logging into my SMF boards, then hitting the link to my WP. I still have to log in.

Not really sure what is going on there. Although I can see that now all my WP users have an imported account into my SMF boards.

Am I missing something?

jjgallow

Hello chemeng,

What kind of paths do you have to wordpress and smf?  What is the directory structure, and:

Do you have subdomains?

I'll see if we can figure this out  :)

jjgallow

Hello pftq,

I will include an option in future versions.   How's that sound?

Now, if others have an opinion on this and I find that there is a consensus, I'd also be fine with changing future scripts to always allow upper-case usernames for Wordpress.  As long as everyone realizes the limitations of that.

pftq

Sounds good.  If it worries you, you can always default it to disable uppercase names.

I'm finding that SMF does not remember my login lately.. (wordpress stays logged in though) It's as if the "Stay logged in forever" box is not working.  Perhaps I edited something wrong when I was enabling the uppercase names on my end - do you have any suggestions where I should look?

ChemEng1

Quote from: jjgallow on August 03, 2007, 03:53:16 PM
Hello chemeng,

What kind of paths do you have to wordpress and smf?  What is the directory structure, and:

Do you have subdomains?

I'll see if we can figure this out  :)

(Please dont laugh at the site. Im doing all this to learn more about developing websites.)

Wordpress is installed here: site hxxp:www.workingmansblog.com [nonactive]
SMF is installed here: hxxp:www.workingmansblog.com/mb [nonactive]

I have site hosted through godaddy and godaddy did the install of both through their Metropolis service.

Not sure how to answer you directory structure question though.

brainiac744

pftq, I had the same problem, but for now instead of tracking down where the login period problem lies, I just editted my cookie to last until 2038. If you find out why this happens I would be very happy, or if I decide to try and find out where the problem is I'll share it with you.

jjgallow

Hello ChemEng...

Just checking here, but did you install the Twin plugin for SMF?  Or do you just have the one plugin for wordpress installed?

cheers :)

jjgallow

The problem lies in SMF_Wordpress, and it appears to exist in all versions of it from 1.06 through 1.09.  I'm unable to identify it, as my test server is down.  When I figure it out, I will update the code.

Quote from: brainiac744 on August 03, 2007, 08:39:29 PM
pftq, I had the same problem, but for now instead of tracking down where the login period problem lies, I just editted my cookie to last until 2038. If you find out why this happens I would be very happy, or if I decide to try and find out where the problem is I'll share it with you.

Advertisement: