Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /********************************
- Author: Tymoteusz `Razor Meister` Bartnik
- Contact: battnik90@gmail.com
- Function: actions_logs()
- ********************************/
- class actions_logs
- {
- private static $name;
- private static $cfg;
- private static $enabled_functions=array();
- public function construct($event_name)
- {
- global $cfg;
- self::$cfg = $cfg[$event_name];
- self::$name = $event_name;
- foreach(self::$cfg['info'] as $func => $enabled)
- if($enabled)
- self::$enabled_functions[] = $func;
- }
- public function before_clients()
- {
- global $query, $query_sql, $xbot, $language;
- $actions = $query_sql->query("SELECT * FROM `actions` ORDER BY `id` DESC");
- while ($row = $actions->fetch_assoc()) if($row != '') $data[] = $row;
- $i=0;
- $desc = "[hr][center][size=14][b]".self::$cfg['top_description']."[/b][/size][/center][hr][table][tr]
- [th][size=15][/size][size=9] [B][U]Fecha[/U][/B] [B][U]Hora[/U][/B] [B][U]ID[/U][/B] [B][U]Evento del servidor[/U][/B] [/size][/th][/table]\n\n";
- foreach($actions as $action)
- {
- if(in_array($action['name'], self::$enabled_functions))
- {
- $i++;
- $date_day = date('d-m-Y', $action['date']);
- $date_hours = date('G:i:s', $action['date']);
- $id = $action['id'];
- if (!preg_match("/(\d{2}):(\d{2}):(\d{2})$/", $date_hours))
- {
- $date_hours = "0".$date_hours;
- }
- $desc .= "[b]• | ".$date_day." | ".$date_hours." | ".$id." | [/b] - ".$action['text']."\n";
- }
- if($i == self::$cfg['records'])
- break;
- }
- $desc .= $language['function']['down_description'];
- if($xbot::check_channel_desc(self::$cfg['channel_id'], $desc))
- $xbot::check_error($query->channelEdit(self::$cfg['channel_id'], array('channel_description' => $desc)), self::$name, self::$cfg['channel_id'], true);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement