News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Generating conversations during or after upgrade to 2.x possible?

Started by CrescentEclipse, August 27, 2015, 04:46:58 AM

Previous topic - Next topic

CrescentEclipse

Hi, I want to upgrade from 1.1.20 to 2.0.10 and would like to have the conversation mode for all migrated personal messages.
Basically, this could be done based on the subject and the recipients, right?
Is there a way to do this?

LG Cres

Illori

the user would have to enable that feature as it is not a global option that the admin can enable [without a mod].

CrescentEclipse

Okay, maybe my provided information is insufficient.

I think the PMs are stored in the DB as conversations anyway,  but the user can select the view he/she sees.
But, if you migrate your 1.x installation to 2.x then the id_pm_head is the same as id_pm, therefore no conversation is available.
I was curious if it is possible to automatically generate the conversation in the DB after the migration for the old messages based on the subject. This is my goal. I hope you can understand my intention now :)

CrescentEclipse


margarett

Not really, sorry.

What bugs me is that you lost conversation mode during the upgrade and that shouldn't happen :o
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Illori

Quote from: margarett on September 02, 2015, 05:35:16 AM
What bugs me is that you lost conversation mode during the upgrade and that shouldn't happen :o

they did not loose it, 1.1.* did not have it. they want to add it to the PMs that users received when the forum was 1.1.*.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

CrescentEclipse

Quote from: Illori on September 02, 2015, 05:41:04 AM
they did not loose it, 1.1.* did not have it. they want to add it to the PMs that users received when the forum was 1.1.*.

Exactly. I thought some users might have had the same idea before and a solution exists for this problem.
I already know what I would do, but I do not have the PHP or mysql skills to do this.

Really sad.

Illori

considering that we dont like to promote ways to read or find out about the contents of PMs in the database i think this is too close to that for us to even suggest a possible solution.

margarett

Well, it's "just" a matter of writing some automated script that would handle it so no access to PMs is required ;)

That being said, I just spent some minutes looking into it. It should be doable, although it *might* fail in some cases because it would have to be based on subject, specifically the "Re: " string...
Do you know how many PMs are stored in your database?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

CrescentEclipse

Quote from: Illori on September 03, 2015, 05:17:05 AM
considering that we dont like to promote ways to read or find out about the contents of PMs in the database i think this is too close to that for us to even suggest a possible solution.

I understand your concern, but if I want to read the content of PMs, then I would have done so already. But that is not my interest. I handle my administrative tasks with privacy intact. This can be done without the body field, only with the fileds id_pm, id_pm_head, id_member_from, subject, id_member

I currently am learning stored procedures, but I am far from achieving anything jet.

@margarett
To answer you question, there are 854 messages.

What about this SQL code and looping through the results?

SELECT T_PM.id_pm, T_PM.id_pm_head, T_PM.id_member_from, T_PM.subject, T_PMR.id_member
FROM tdb_personal_messages T_PM
LEFT JOIN tdb_pm_recipients T_PMR ON T_PM.id_pm = T_PMR.id_pm
ORDER BY T_PM.id_pm ASC;


But you must look out for changes of user ids and subject changes. First message is always the one without "Re:" and then save the "from user id" and "to user id pair(s)" and keep in mind that every following message with the "Re:" and the specific user ids is packed in one conversation. If the same subject without "Re:" is found later on, this must be a new conversation. This must be done for every conversation, so i think an array is needed.

That is only a rough description in plain text how I thougth this could be done.
Thanks for any help.

margarett

Yes, I think you are correct. The gathering of info is pretty much like you present ;) It's the treatment of that information which concerns me as it's far from linear. Eg, in this forum, "(no subject") should probably reach 50% of all PMs ;D
Also, a user can send a PM to himself or he can change recipients throughout the conversation, which invalidate the "pairs"...

The reason why asked you about the number of PMs is because I think that we need all the information on a single array. 854 entries in an array is perfectly possible (memory-wise), it you answered "1.000.000" it would kill all chances immediately :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

CrescentEclipse

Yes, these kind of problems are in my mind, too. This makes everthing more complicated.
But I am happy to hear, that a script is possible :)

CrescentEclipse

I really appreciate your help, margarett.
Did you found some time to look into it?

margarett

Not really, no :(

And I also need to properly populate my test board PMs to get some valid content...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: