Advertisement:

Author Topic: How-to Add Database column  (Read 1153 times)

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
How-to Add Database column
« on: December 17, 2017, 08:06:49 AM »
Hi there,

SMF 2.0.13
In phpmyadmin:

The database "Personal_Messages" contains a From_Name column, not a To_Name column.
Sending a PM is always From a member To a member.
Is there a way to add such a To_Name column?

Thanks in advance.

SoftAid

SoftAid@oplossing.be

SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #1 on: December 17, 2017, 08:53:24 AM »
Why would you need to add a to_name? You need a from name so that if people delete their account, it doesn't delete the messages that were sent to people. But you don't need that for to people because you can always look up the names from the database.

And as for who gets a message, that's what the recipients table is for.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #2 on: December 17, 2017, 09:32:44 AM »
Hello Arantor,

Thank you for answering.
Why would you need to add a to_name?

My question was: "Is there a way to add such a To_Name column?". But to answer your question:
Some menbers abuse the PM to send false information to other members. Most of that false information consists on pointing to other websites.
As rsponsable and moderator, I would like to be able to see immediatly to who such member those messages are send.
And as for who gets a message, that's what the recipients table is for.
The PM-Recepients table does not give this information. It gives me an ID_memder, but even if this is the PM-receiver, the table is to short, and looking up names that fit with the ID (in an other table is a long work-arround.

So, Is there a way to add a To_Name column?

Thank you.

SoftAid
SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #3 on: December 17, 2017, 09:40:21 AM »
How do you think SMF works out who gets a message? The id_menber column of the recipient's table is the same as the id_member in smf_members. You don't need a to_name column, because SMF already has that information!

The only issue is that you don't know how to get it out of SMF by doing a join from the recipient's table to the members table. And discussing that (or having a mod to spy on PMs) is generally not allowed because we don't like to encourage people doing exactly what you're trying to do. There is a reporting function hat people should use instead.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #4 on: December 18, 2017, 05:43:54 AM »
Hello Arantor, or shall I call you Arrogantor :(

It please me to have a reaction like yours instead of an helping hand. Accusing me of spying is so easy, helping one out takes much more from your brains than they can handle, I suppose. I feel so sorry for you. Maybe my expectations on you were to high.

And No, I don't SPY on people, I moderate and try to maintain the site clean.
You could have answered that what I asked was not possible, or that it was not allowed to do what I asked for.
You preferred to accuse me of spying. What a nice guy (or girl) are you.
Don't bather anymore. You make me sick, and I would not like to be infected by your disease.

To bad my English is not that good, otherwise I would love to go in discussion with your twisted mind.

Please don't you ever react anymore when I post a question. Thank you for that.

Softaid
 
SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #5 on: December 18, 2017, 06:37:58 AM »
Im sorry, I didn't mean to rile you up, I was just frustrated that what you ask for, you don't need because the information is already present, and that by rules I didn't put in place, I can't really discuss it (as the rules are generally that people who want to do this do so for spying, which you kind of admitted to - most times, the report to moderator function is enough)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,402
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: How-to Add Database column
« Reply #6 on: December 18, 2017, 06:43:59 AM »
Arantor is being polite in his reply. I won't be.

Hello Arantor, or shall I call you Arrogantor :(

It please me to have a reaction like yours instead of an helping hand. Accusing me of spying is so easy, helping one out takes much more from your brains than they can handle, I suppose. I feel so sorry for you. Maybe my expectations on you were to high.

And No, I don't SPY on people, I moderate and try to maintain the site clean.
You could have answered that what I asked was not possible, or that it was not allowed to do what I asked for.
You preferred to accuse me of spying. What a nice guy (or girl) are you.
Don't bather anymore. You make me sick, and I would not like to be infected by your disease.

To bad my English is not that good, otherwise I would love to go in discussion with your twisted mind.

Please don't you ever react anymore when I post a question. Thank you for that.

Softaid
 

He wasn't accusing you of spying. He was stating it as fact. PM means PRIVATE message. The reading of anyone's PRIVATE message is spying, no matter how you sugarcoat it. Reading private messages doesn't fall under the job description of moderator.

There will be no further outbursts disrespecting other members like this.
Online Manual

Please do not PM me for support.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #7 on: December 18, 2017, 07:08:58 AM »
Hi Steve,

Arantor was defenitly accusing me of spying, and you do the same. And I am well aware what Private means, No need to write it in Bold.
Reading private messages doesn't fall under the job description of moderator.
To protect my members from hackers, or from malicious (Personal) messages, I will check when necessary. My members trust me.
I understand that this is not a general for all websites. But in our case it is. 
There will be no further outbursts disrespecting other members like this.
I didn't start "disrespecting".
Like I wrote before, Arantor could have informed me in a professional way, instead of calling me a spy.
OK, I will hold my horses, if you hold yours (and Arantor will hold his)
I suppose I will not get an answer on my technical question anymore.

Thank you anyway.

SoftAid

SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #8 on: December 18, 2017, 08:22:38 AM »
You already had a technical answer from one of the people who has literally been a developer of the platform.

SMF records all the recipients of a message in the recipients table. You can do a join to the members table to find out who a message was sent to.

You can't do it at the message table level because one message can be sent to more than one person.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #9 on: December 18, 2017, 09:31:36 AM »
Hello Arantor,

Steve is right, my outburst to you was unacceptable. You calling my work spying made me pissed. I should have hold myself in hand and react professional to.
But I have that temper, hard to  suppress. I hope you can accept my apologies.

You already had a technical answer from one of the people who has literally been a developer of the platform.
I only talked to you.
SMF records all the recipients of a message in the recipients table. You can do a join to the members table to find out who a message was sent to.
I do not know what you mean by "doing a join". My (technical) English is limited, and I think you use a kind of "slang" here.
For me, a "join" would mean "putting records together".
As I wrote before "The PM-Recepients table does not give this information. It gives me the ID_memder, but this is the PM-sender.
The PM_messages does not have a receiver-ID.
You can't do it at the message table level because one message can be sent to more than one person.
I have to admit I did not thought on this.  You are right, the PM_Messages table cannot hold infinity number of receivers.

Can you explain in details how you would work around my problem to get the receiver(s) ID or Name? It means much for me to keep the forum clean.
If I would like to spy, than I would just go in the PM_Messages, edit it and read wat one wrote to another. I do not need this. That is private and I do not look for this.

Sometimes I see new members, and find them sending PM's to other members, and some of those recipients complain to me about advertising in those PM's.
Some PM-recipients are not aware they get links to malware distributing sites.  I would like to be able to send a warning to those recipients. That's were it's al about for me.

SoftAid

SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #10 on: December 18, 2017, 09:38:57 AM »
Yes, I know you only talked to me. I have literally been part of the development team of this platform.

I cannot, as mentioned, explain it to you in detail. Because other people have in the past used information about the PM system to spy on members inappropriately, it is generally frowned upon to discuss it. It also doesn't help that I'm currently at work and can't exactly look up the database structure.

However, what I can say is that there is the pm recipients table, which has one row per PM recipient, and lists the id of a message and the id of one recipient of that message. The first id ties back to the pm message table, the second back to the members table.

So if you're looking up message 1 in the pm messages table, you can do

SELECT men.real_name FROM smf_members AS mem INNER JOIN smf_pm_recipients AS pmr ON (pmr.id_member = mem.id_member) WHERE pmr.id_pm = 1

Then just change the 1 to whichever PM you're looking at. At least, I think those are the column names, it's been a while.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #11 on: December 18, 2017, 10:17:21 AM »
Hello Arantor,

Thanks for your help. If you are at work, I do not want to disturb you. There is no hurry with my problem.

I also understand your concern on this item. Please feel free to remove this topic entirely if it's better for everyone's security.

I executed the SQL query in smf_personal_messages, but it returns an error: " #1054 - Unknown column 'men.real_name' in field list"
The "real_name" column exists in the smf_members.
Take your time, there's no hurry.

Thank you in advance.

SoftAid
SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,307
    • StoryBB/StoryBB on GitHub
Re: How-to Add Database column
« Reply #12 on: December 18, 2017, 10:24:01 AM »
Damn auto correct. It should be mem not men, short for members.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #13 on: December 18, 2017, 10:52:11 AM »
Hello Arantor,

The query worked now, and returned the expected value (name).
It is a work-around, but it works. I am very thankful for the help 8).
I am even more thankful that I may use your software for many years now.

We (our forum) helps people with all computer-related problems, for free, without advertising, and in-depth help for almost 20 years.
All helpers are volunteers.

Thanks again.

SoftAid


SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)

Offline SaltedWeb

  • Sr. Member
  • ****
  • Posts: 859
  • Gender: Male
  • The Tired One
Re: How-to Add Database column
« Reply #14 on: December 18, 2017, 11:16:49 AM »
Softaid, just an FYI other forums say like Xenforo and others have similar conversations on this form of activity.
And most users of said forums think PM means private.
Allot of people myself included use PM for making deals, sales, or meetups. I realize the rules on a site are that of the owner.
But if some one is going to ever consider having access to PM info they should clearly state it on their agreement.txt
I have runs sites for along time, and sure there are hackers, those that may do bad things but privacy does mena allot to many peole
self included. People in the United States despise for the most part the Patriot Act, for the same reason seeing others PM is not something people like.
We like our privacy even if we never use it for private stuff its just something most people don't like.  Not saying your doing that but being the topic
was something I have allot of personal discussions against accessing members private info. Good luck on your endeavors.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Offline SoftAid

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
  • 15 jears happy working with SMF: Thanks
    • Oplossing.be
Re: How-to Add Database column
« Reply #15 on: December 18, 2017, 12:52:33 PM »
Hallo SaltedWeb,

I'm from Belgium, but that doesn't mean I'am not familiar with the mentality of the American people. I have relatives living in Denver, Colorado, in Los Angeles, en Florida. We used to travel much to the states, traveling with a van from the East to the West when I was young(er). Now, I'm going to become 70, the flight is to long, the ride is to heavy.

But I do understand your concern. It's my concern to.

I learned a lot today, about myself (going in defense-mode to easily), I learned that there are many ways to solve a problem, I learned that no-one is perfect, not even me :).

I also will keep you advice in mind, and change the rules of my site, pointing that for the safety of the members, PM's MAY been checked if necessary. So no-one can blame me.

Altogether it was a good day. Thanks to all of you.
 
From Belgium, with lots of respect,

SoftAid 
SMF forum 2.0.13
Dutch free computer help forum
Always welcome on Oplossing.be :-)