thecjgcjg
Veteran Member
Posts: 1,459
| Likes: 1,130
|
Post by thecjgcjg on Aug 28, 2014 21:09:48 GMT
<?php function contains($needle, $haystack) { return strpos($haystack, $needle) !== false; }
function curlUrl($url) { $ch = curl_init(); $timeout = 2; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; }
if (!isset($_POST['length']) OR !isset($_POST['chat']) OR !isset($_POST['commands']) OR !isset($_POST['worldedit']) OR !isset($_POST['errors']) OR !isset($_POST['filterKickBans']) OR !isset($_POST['loginlogout'])) { die('Not all POST requests sent'); }
$log = curlUrl('http://server.ip.address.yay:28966/logs?password=test');
if ($log = "Incorrect password.") { die('Incorrect password entered in PHP script for TotalFreedomMod HTTPD'); }
file_put_contents('savedlogs.yml', $log); $length = $_POST['length'] + 0;
$logs = file('savedlogs.yml'); $logs = array_slice($logs, count($logs)-($length+1), $length);
for ($i = 0; $i < count($logs); ++$i) { $type = 'chat'; if (contains('[PLAYER_COMMAND]', $logs[$i]) OR contains('[PREPROCESS_COMMAND]', $logs[$i]) OR contains('issued server command:', $logs[$i])) { $type = 'commands'; } elseif (contains('WorldEdit', $logs[$i])) { $type = 'worldEdit'; } elseif (contains('[TotalFreedomMod] [ADMIN]', $logs[$i])) { $type= 'adminChat'; } elseif (contains('Server thread/ERROR]', $logs[$i])) { $type = 'errors'; } elseif (contains('/gtfo', $logs[$i]) OR contains('/ban', $logs[$i]) OR contains('/glist', $logs[$i]) OR contains('/tempban', $logs[$i]) OR contains('/kick', $logs[$i]) OR contains('/kicknoob', $logs[$i])) { $type = 'kickBan'; } elseif (contains(' [JOIN] ', $logs[$i]) OR contains(' [EXIT] ', $logs[$i]) OR contains('logged in with entity', $logs[$i]) OR contains('lost connection:', $logs[$i]) OR contains('Disconnecting ',$logs[$i])) { $type = 'loginLogout'; } echo "<span class='" . $type . "'>" . htmlspecialchars($logs[$i]) . "</span><br />"; } unlink('savedlogs.yml'); ?>
|
|
aggelosQQ
Club 4000 Member
Posts: 6,439
| Likes: 4,127
|
Post by aggelosQQ on Aug 28, 2014 21:18:46 GMT
@vj13573, and that's PHP^ ... C:
|
|
aggelosQQ
Club 4000 Member
Posts: 6,439
| Likes: 4,127
|
Post by aggelosQQ on Aug 28, 2014 21:22:09 GMT
@vj13573, and that's PHP^ ... C: What is PHP? CJ's post above of mine
|
|
aggelosQQ
Club 4000 Member
Posts: 6,439
| Likes: 4,127
|
Post by aggelosQQ on Aug 28, 2014 22:28:48 GMT
CJ's post above of mine I asked what is it? not the coding ;p I bet it's similar to Java. You lost :/ PHP is for websites ;p
|
|
Madgeek
Veteran Member
Steven Lawson
Posts: 2,674
| Likes: 1,460
|
Post by Madgeek on Aug 28, 2014 22:43:57 GMT
You can use pretty much any language to serve dynamic websites, including Java.
|
|
Madgeek
Veteran Member
Steven Lawson
Posts: 2,674
| Likes: 1,460
|
Post by Madgeek on Aug 28, 2014 23:39:11 GMT
Ok folks, I've published the source code for TF's log viewer. Take note that I'm considerably more experienced with Java, so this isn't quite as pretty as TFM's stuff. github.com/StevenLawson/TFLogViewer
|
|
Cowgomooo12
Club 4000 Member
Vaarwel, afscheid
Posts: 4,894
| Likes: 5,266
|
Post by Cowgomooo12 on Aug 28, 2014 23:43:02 GMT
Cowgomooo12's semi-right dictionary of words: PHP - Personal Home Page <a href="http://internetslang.com/PHP-meaning-definition.asp">(?)</a> - Its similar to HTML but involves dynamic responds including input/out responses HTML - Hypertext Markup Language - It is the backbone of the internet, static webpages and doesn't change. Java - {None} - Programming language used for many devices including cars, may contain standalone or dependent resources JavaScript ("JS") - {None} - Dynamic programming language depending of the client-side respond, dependent on web-browser Python - {None} - Complex Programming language, made for both large and tiny scale work | 3rd parties allow Python scripts to be ran without requiring to install Python. Please note, I didn't exactly use any *trustworthy* 3rd party to help me, so I'm 99% sure something is incorrect in my writing.. Please, ask questions please ask Google, lmgtfy.com
|
|
Madgeek
Veteran Member
Steven Lawson
Posts: 2,674
| Likes: 1,460
|
Post by Madgeek on Aug 29, 2014 0:02:34 GMT
Cowgomooo12's semi-right dictionary of words: PHP - Personal Home Page <a href="http://internetslang.com/PHP-meaning-definition.asp">(?)</a> - Its similar to HTML but involves dynamic responds including input/out responses HTML - Hypertext Markup Language - It is the backbone of the internet, static webpages and doesn't change. Java - {None} - Programming language used for many devices including cars, may contain standalone or dependent resources JavaScript ("JS") - {None} - Dynamic programming language depending of the client-side respond, dependent on web-browser Python - {None} - Complex Programming language, made for both large and tiny scale work | 3rd parties allow Python scripts to be ran without requiring to install Python. Please note, I didn't exactly use any *trustworthy* 3rd party to help me, so I'm 99% sure something is incorrect in my writing.. Please, ask questions please ask Google, lmgtfy.com
|
|
thecjgcjg
Veteran Member
Posts: 1,459
| Likes: 1,130
|
Post by thecjgcjg on Aug 29, 2014 0:36:29 GMT
Ok folks, I've published the source code for TF's log viewer. Take note that I'm considerably more experienced with Java, so this isn't quite as pretty as TFM's stuff. github.com/StevenLawson/TFLogViewerI made a a very similar one to yours, no FTP, just TFM HTTPD, but I used BootStrap so it looks different. Also doesn't use MySQL so should be simpler to use. I started before Mad open sourced it, so it probably works completely differently. Source: github.com/TheCJGCJG/TFM-LogviewerScreenshots
|
|
Wild1145
Club 4000 Member
Inactive Player & Inactive Senior Admin
Posts: 10,414
| Likes: 9,680
|
Post by Wild1145 on Aug 29, 2014 0:41:30 GMT
Ok folks, I've published the source code for TF's log viewer. Take note that I'm considerably more experienced with Java, so this isn't quite as pretty as TFM's stuff. github.com/StevenLawson/TFLogViewerI made a a very similar one to yours, no FTP, just TFM HTTPD, but I used BootStrap so it looks different. Also doesn't use MySQL so should be simpler to use. I started before Mad open sourced it, so it probably works completely differently. Source: github.com/TheCJGCJG/TFM-LogviewerScreenshots The MySQL was for authorizing IP's, I presume you have something like that?
|
|
thecjgcjg
Veteran Member
Posts: 1,459
| Likes: 1,130
|
Post by thecjgcjg on Aug 29, 2014 0:42:24 GMT
I made a a very similar one to yours, no FTP, just TFM HTTPD, but I used BootStrap so it looks different. Also doesn't use MySQL so should be simpler to use. I started before Mad open sourced it, so it probably works completely differently. Source: github.com/TheCJGCJG/TFM-LogviewerScreenshots The MySQL was for authorizing IP's, I presume you have something like that? Ye. I wrote it just using a .json file cause chances are the people who will be using this won't know how to setup a MySQL server
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 29, 2014 15:46:58 GMT
So @vj13573, don't even try Wut, try wut i wanna trai et :S
|
|