Games (inc Online)Teh Mine

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
38140.2810 In reply to 38140.2808 
:D I shall put that into use!
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  af (CAER)     
38140.2811 In reply to 38140.2809 
I think it's in seconds because it's currently "5" so I'll increase that too.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2812 In reply to 38140.2810 
Oh that'll do every chat message in the log though so...

PHP code:
<?
 
$things = file('server.log');
$chats = Array();
 
foreach ($things as $thing) {
	if (strpos($thing, "[INFO] <")) {
		$chats[] = htmlspecialchars(substr($thing, 27));
	}
}
 
$chatt = implode("<br />", array_slice($chats, -30));
echo $chatt;
 
?>


That'll get the last 30. Change the -30 on line 12 to adjust.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Drew (X3N0PH0N)     
38140.2813 In reply to 38140.2812 
(I left $chatt as a variable so you can regex some styling into it if you want)
0/0
 Reply   Quote More 

 From:  Ken (SHIELDSIT)  
 To:  Drew (X3N0PH0N)     
38140.2814 In reply to 38140.2813 
You are such a hard core haxor!
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
38140.2815 In reply to 38140.2813 
Give it a try on the mini-site. It's not linking to the live server.log, but just want to see if everyone else can see it.
0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Drew (X3N0PH0N)     
38140.2816 In reply to 38140.2812 
can you make it not include all the bollocks where people turn on the sun or turn off the rain etc?

Jon
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2817 In reply to 38140.2815 
Works for me.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  JonCooper     
38140.2818 In reply to 38140.2816 
He's already done that.
0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  ANT_THOMAS     
38140.2819 In reply to 38140.2815 
I can see that too

Jon
0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  ANT_THOMAS     
38140.2820 In reply to 38140.2818 
he is such a clever dude :)

Jon
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  JonCooper     
38140.2821 In reply to 38140.2819 
Good stuff. I wasn't sure if PHP could link to a local IP.
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  ALL
38140.2822 
Hard Work has made me the most amazing entrance system to my soon to be built scuplture gallery from the painting gallery. I will soon me accepting commissions for sculptures (modestly sized only) .

Roses are bollocks, Violets are crud, I hate bloody flowers, And much prefer mud.
0/0
 Reply   Quote More 

 From:  Radio  
 To:  ALL
38140.2823 
Where's this mini site then?
My life is hard, I suffer lots
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Radio     
38140.2824 In reply to 38140.2823 

It's on the first post of the thread (I try to keep post 1 updated)

 

http://mine.tehforum.co.uk/site/

0/0
 Reply   Quote More 

 From:  Matt  
 To:  Drew (X3N0PH0N)     
38140.2825 In reply to 38140.2812 
Seeing as you asked so nicely.

php code:
 
<?php echo nl2br(htmlentities(`tail -n 30 server.log | grep '\[INFO\] <' | cut -b 28-`));


Also, Andy?! Did you just wake from a coma?

doohicky

0/0
 Reply   Quote More 

 From:  Chris (CHRISSS)  
 To:  ANT_THOMAS     
38140.2826 In reply to 38140.2793 
Would that not just be the number of lines the client shows, so not a server thing? I'm not that bothered if it's not an easy fix. Would be nice in the browser for the text to show for longer though, and be able to bring up recent messages like bringing up the chat windows in game.

Chrissywissywoo
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Matt     
38140.2827 In reply to 38140.2825 
Andy Caer.

And thanks :D
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
38140.2828 In reply to 38140.2827 

How do I reverse the output so the newest is at the top?

 

I've tried "array_reverse" in various places with no luck yet.

0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
38140.2829 In reply to 38140.2828 
$things = array_reverse(file('server.log'));

Should do it?
0/0
 Reply   Quote More 

Reply to All  
 

1–20  …  2761–2780  2781–2800  2801–2820  2821–2840  …  3921–3934

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats