/** * Gets the current instance of the class, there can only be one instance (this make the class a singleton class) * note: this is needed as a work around for the inc.php file do not change * * @return object $instance - the current instance of the class */ public static function getInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }
<?php $auth_name = 'chatlogs'; $b3_conn = true; require '../../../inc.php'; $plugin = chatlogs::getInstance(); if (isset($_REQUEST['talkback'])) { if ($mem->reqLevel('chats_talk_back')) { // extra perms needed to talk to server if (!empty($_GET['last-id'])) { $last_id = cleanvar($_GET['last-id']); } else { $last_id = 0; } $data = $plugin->talkback($_REQUEST['talkback'], $_REQUEST['srv'], $last_id); // send rcon talkback / get data for buildLine if (detectAJAX()) { // if is AJAX request echo $data; } else { sendBack(''); } // sendBack with no error } } if (isset($_GET['auto'])) { echo $plugin->getLastChats($_GET['table-num'], $_GET['last-id']); } if (isset($_POST['tables'])) { if ($mem->reqLevel('chats_edit_tables')) { // extra perms needed to edit settings