Thread: Mys 1.3.4 News System
View Single Post
  #29  
Old 12-08-2014, 01:45 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,361
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by parayna View Post
Hello, I know this hasn't been commented on for a while but do you know how to get the 'Send message to all users notifying about the existence of an update' button working? I think I recall you saying it doesn't work yet but I am thinking of trying to get it working..

Would it be possible to have it so that when that box is ticked it automatically updates the 'messages' database table? (Maybe not an email, just a PM on your site) As in, when you tick it every user on the site gets a PM from 'SYSTEM' or even just the admin...

Would that be possible? Sorry for bugging XD

~Parayna
Sorry, I didn't get back to this mod because my host started having problems and the loading times were too crazy to get anything done.

My idea was to send a PM to everyone in the site. The condition to send PM's is already there:

newview.php
PHP Code:
  else{
                            
            
$mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "yes","allowcomment" => $allow));
            
                if(
$mysidia->input->post("allowmessage")){
                    
//$mysidia->db->insert("");
                
}
            } 
Next, inside the if, you'd need to retrieve all user ID's from the users table and use a loop to add the message to the messages table, one for each user (you might need the username instead of the userid, I don't remember which one the messages table uses x.x). This was my first idea, I wanted to do something prettier but I didn't come up with anything else lol
__________________


asp.net stole my soul.
Reply With Quote