The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Group Messages possible?
#1
Hi!
I wonder if it is possible to tweak the message system for group threads/messages.

I already modified the messages.php and wrote a function which allows me to send messages to user groups. That wasn't too difficult. But the downside is (btw the same as if the admin sends a mass message), that the same message to every group member appears in my message-box. If someone replys he just replys to the one who wrote the message.

My purpose: Teachers should be able to send messages to classes. Therefore I've got a database named "klassen" (classes) which contains every class. The user administration (a separate permission level) manually creates the students accounts which are not only inserted in the "users" table but also in a table called "u_schueler" (u_students). This table contains the user_id (id from the users table), username, the fname/lname and the class the student visits.

At the moment it is enough for teachers to send messages to classes (I don't need messages between teachers or students). So I disabled the reply function for the students (with the super useful hasPerm function). But with 30 students per classes the message box for teachers gets rapidly unorganized.

Here is the code which works for me: https://hastebin.com/ocotesiyeq.bash

I know that it's not the best programming style but I started coding in the last two weeks. Some days ago I didn't even knew what MYSQL is. My main goal is that it works - the beauty comes with the experience

So all in all my main goal is achieved: Teachers can send group messages to a classes. My next goal is to reduce the ~30 messages in his message box, every time he does that. Does somebody have any idea which steps are needed? I'm not asking for a complete guide or code - all I need is some input/ideas where to start or which structure needs to be modified.

Have a nice day Smile
  Reply
#2
Hi @s.farg,

Sorry for taking so long to reply.

I'm going to look into this further, I just have to piece it together in my head a bit more!

B.
  Reply
#3
Hi Brandin! No problem, I thought about it for a little longer. I try to describe my purpose a bit better: I have user groups and want an individual to be able to send a message to a user group (thats what I have now). The message should appear only once as "sent" in the messages.php. Currently I have the same message for every person in the group (its the same if you send a mass message as administrator). For example: There are 30 accounts in one group. If someone sends a message to this group he has 30 messages/threads. For each indiviudal one thread. I want to have one thread where everyone can reply and everyone can see the replys (like Whatsapp groups). I've already made a plan how to adjust the databases etc. But I have other things to implement which are more important right now. I definitely will post the solution here if I come up with one. Smile
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)