Advertisement:

Author Topic: YaBB2.1 -> SMF - Personal Messages Problem  (Read 44553 times)

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
YaBB2.1 -> SMF - Personal Messages Problem
« on: July 25, 2008, 04:37:09 PM »
After finally getting the forum converted (many thanks SleePy!), I've noticed that there are some issues with Personal Messages.

First, the date of all members PM's is December 31, 1969, 11:00:00 PM. Looking at the database, the msgtime field has 0 for all PM's for all members.

Second, only PM's in members inboxes where converted. All PM's in outboxes are missing. It also appears that PM's in members PM Storage are missing too.

Any ideas?
« Last Edit: July 25, 2008, 04:50:58 PM by JMB »

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #1 on: July 25, 2008, 05:44:40 PM »
That date is the default date when the date cannot be fetched.

I would say I could help you out, but at this point I'm afraid there is little you can do without having to do an immense amount of work.

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #2 on: July 25, 2008, 05:48:34 PM »
Hi ccbtimewiz,

As I'm still in the testing phase, running everything locally, I don't mind doing the conversion from scratch again, if its something that can be fixed by editing the conversion scripts.

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #3 on: July 25, 2008, 06:58:12 PM »
OK, I found an old version of yabb21_to_smf.php I'd used to convert a forum at the beginning of the year. The PM dates converted OK back then, so I compared the two files.

In cstep4, I changed:

Code: [Select]
'msgtime' => empty($userData[$i][2]) ? (int) $userData[$i][2] : '0',


to:

Code: [Select]
'msgtime' => $userData[$i][2],


which was in the old file.

I reran the converter and this time it populated the msgtime field properly.

So, that's one thing fixed. Still the Outbox and Storage PM's missing though.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #4 on: July 26, 2008, 04:09:32 AM »
Thanks for the first one. the bug was I used "empty" instead of "!empty" in that code.

The converter forces the pms to not show in the outbox, it sets it as deleted by sender.

You can try this, I haven't tested:
Find:
Code: [Select]
                    'deleted_by_sender' => 1,
Change to:
Code: [Select]
                    'deleted_by_sender' => 0,
I am not sure of the repercussions of this though without testing it.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #5 on: July 26, 2008, 04:48:51 AM »
Hi SleePy.

Yep, !empty works.  :D

I tried changing deleted_by_sender to 0. It populates outboxes with sent messages that haven't been deleted by the receiver. That's a good start!  ;) Is there any way to process the .outbox files and bring all the messages back into the outbox?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #6 on: July 26, 2008, 02:19:16 PM »
All messages should be in the outbox now that the user has sent?
That change just tells SMF that the person who sent it didn't delete it, so now it shows in their outbox. So this means every message sent is now showing in their outbox.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #7 on: July 26, 2008, 03:04:58 PM »
All messages should be in the outbox now that the user has sent?
That change just tells SMF that the person who sent it didn't delete it, so now it shows in their outbox. So this means every message sent is now showing in their outbox.

No, because only messages in the .msg files where converted. So that's only messages that members had in their inbox. Those are now in the senders outbox, but some messages are missing from the outbox. The missing messages are ones that the receiver had deleted, so they never got converted as they weren't in the .msg files. Those missing messages are in the .outbox files that don't seem to get converted.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #8 on: July 26, 2008, 03:12:26 PM »
Hmm, I don't know how easy it would be to fix that.
The message then no longer exists in the .msg file for the user it was sent to then. So the importing would need to check that out. Or it would need to add more messages into the pms table but force the messages to always either have been deleted by sender or receiver.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #9 on: July 26, 2008, 03:47:17 PM »
Yeah, something like that! Sounds a bit tricky, but I'm no programmer.  ;)

Then there is the PM Storage box on YaBB. That's not getting converted either. I would think that would be more simple to do. Just import all the messages in the .imstore files and add them to the users inbox. Looks like the format of the .msg and .imstore files is the same.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #10 on: July 26, 2008, 03:49:36 PM »
Are the messages in those files the ones that where missing from the outboxes of the others?
If that is true, then that is a little easier to fix.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #11 on: July 26, 2008, 05:37:19 PM »
I'm trying to get the logic of this clear in my head...  ;D

YaBB has an Inbox, Outbox and Storage box for PM's. The Inbox messages are in .msg files, the Outbox messages in .outbox files and the Storage messages in .imstore files.

So far, all .msg files have been converted and messages put in members inboxes on SMF. Then we changed the deleted_by_sender to 0. This made sent messages appear in members outboxes, but only messages that the receiver hadn't deleted. OK, that's were we're at...

The .outbox files, contain all messages that the member has in their outbox, so there will be duplicates with the messages that have already been imported, the ones that the receiver hadn't deleted, the ones that are now in the outboxes. But all the rest of the messages that should be in the outboxes are in this file too.

The .imstore file is like an archive for messages and contains other messages not present in either .msg or .outbox files. As SMF doesn't appear to have an archive/storage bit for PM's, it makes sense that they get put into the users inbox.

I think I understand all that! Does it make sense to you?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #12 on: July 27, 2008, 07:54:32 PM »
I think I may have a way to fix it..
Currently working on the yabb 2.2 converter. I will test it out with the new changes once I fix other issues and backport them.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #13 on: July 28, 2008, 05:55:49 AM »
Great news. Thanks SleePy.  ;D

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #14 on: August 12, 2008, 08:17:11 AM »
Hi SleePy,

Any updates or news on this issue?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #15 on: August 12, 2008, 01:28:28 PM »
I was working on this. Finals is nearby though for the summer quarter so I haven't looked at it much.

You can try it if you want. I can't say if it works for sure as I haven't even tested it.
What I did to the conversion is have it check for either a .msg or .outbox file. If it found one then it worked on that file using a variable to decide if it was in the outbox or not to tell it what to do.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #16 on: August 12, 2008, 02:20:13 PM »
Great, thanks SleePy, I'll give it a try!

I've given myself a crash course in PHP and MySQL, so I'm getting the hang of all this.  ;D

So, I may even be able to work a few things out myself!  8)

I'll give it a go and report back.

Thanks again!
« Last Edit: August 13, 2008, 07:49:26 AM by JMB »

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #17 on: August 13, 2008, 07:50:19 AM »
OK, just tried that and it doesn't work. No PM's get converted at all.  :(

The change to this line seems to kill it:

Code: [Select]
if (strrchr($entry, '.') != '.msg' || strrchr($entry, '.') != '.outbox')

If I change it to:

Code: [Select]
if (strrchr($entry, '.') != '.outbox')

It converts all the posts in .outbox as expected. But having both expressions with the OR doesn't work at all...
« Last Edit: August 13, 2008, 08:07:10 AM by JMB »

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #18 on: August 13, 2008, 12:46:48 PM »
Oh, logic error. It should be and :D
Code: [Select]
            if (strrchr($entry, '.') != '.msg' && strrchr($entry, '.') != '.outbox')
Did it convert them correctly and put them in the outbox of that user btw?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline JMB

  • Semi-Newbie
  • *
  • Posts: 50
  • Gender: Male
Re: YaBB2.1 -> SMF - Personal Messages Problem
« Reply #19 on: August 13, 2008, 04:01:27 PM »
Ah ha! Logic was never my strong-point!  ;D

OK, that's better. The inbox looks fine.

The outbox has messages in it, but not the right ones. They appear to be copies of messages sent to that member that the sender has in their outbox, but with the the member listed as the sender! Does that make sense?

Example for a user called Admin.

In Admin's outbox are 16 messages, all with Admin's name next to them, as you would expect being in Admin's outbox. The messages are not ones sent by Admin, but by other members to Admin.

So, I'm assuming these are all the messages to Admin that are in other members outboxes.