* All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * --> NOTICE <-- * This file is part of the core development branch, changing its contents will * make you unable to use the automatic updates manager. Please refer to the * documentation for further information about customizing XNova. * */ define('INSIDE' , true); define('INSTALL' , false); define('IN_ADMIN', true); function mass_message_run($parent){ if($_POST["mode"] == "change"){ if(isset($_POST["tresc"])&& $_POST["tresc"] != ''){ $gameConfig['tresc'] = $parent->safe_get_post_var("tresc"); } if(isset($_POST["temat"])&& $_POST["temat"] != ''){ $gameConfig['temat'] = $parent->safe_get_post_var("temat"); } $kolor = 'red'; if($gameConfig['tresc'] !='' and $gameConfig['temat']){ $sq = $parent->db->query("SELECT `id` FROM {{table}}","users"); while($u = $parent->db->fetch_assoc($sq)){ doquery("INSERT INTO {{table}} SET `message_owner`='{$u['id']}', `message_sender`='1' , `message_time`='".time()."', `message_type`='0', `message_from`='Administracja', `message_subject`='{$gameConfig['temat']}', `message_text`='{$gameConfig['tresc']}' ","messages"); $parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users'); } $parent->smarty->assign("message","Wys�a�e� wiadomo�� do wszystkich graczy"); } } $parent->smarty->display("mass_message.tpl"); } function mass_message_info(){ return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0"); }