This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

/Lusers Output.

Old posts that have not been replied to for several years.
Locked
W
Wasted

/Lusers Output.

Post by Wasted »

hello,
I have a script that prints the output of a /lusers to a txt file, but i can't get it to print...fo example to a .php file as;

Code: Select all

<? $lusers='
<here the same output as the .txt>
'\;" ?>
Does anyone know how I can fix this, or a script somewhere else wich I can use that does that, even?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It would be better if you posted your script.

You state you use PHP, simalar to the one above. That PHP will set a variable, using static content, and not from any file.

If you give a more detailed example/dicription of what you wish, we may understand a little more.
W
Wasted

Post by Wasted »

Ok, here is the script:

Code: Select all

set lusers_setting(page) "/home/public_www/msc/lusers.txt"
set lusers_setting(timer_update) "5"
set lusers_setting(nettype) "4"

####################
# Code begins here #
####################

foreach rb {250 251 252 253 254 255 265 266} { bind raw - $rb lusers_write_lusers }

if {[lsearch -glob [utimers] "* lusers_update *"] == -1} { utimer $lusers_setting(timer_update) lusers_update }

foreach a [array names lusers_lusers_data] { unset lusers_lusers_data($a) }

switch -regexp -- $lusers_setting(nettype) {
	"^1\$" { set lusers_setting(lastnum) "250" }
	"^(2|\[5-7\])\$" { set lusers_setting(lastnum) "266" }
	"^(3|4)\$" { set lusers_setting(lastnum) "255" }
}
proc lusers_rcodes {text} {
	regsub -all -- "\002|\037|\026|\017|\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $text "" text
	return $text
}
proc lusers_write_lusers {from keyword text} {
	set ::lusers_localserver $from
	if {[regexp 252|254 $keyword]} { regsub -all -- ":" $text "" text }
	set ::lusers_lusers_data($keyword) [string trimleft [join [lrange [split $text] 1 end]] :]
	if {[string compare $keyword $::lusers_setting(lastnum)] == 0} { lusers_do_final }
}
proc lusers_do_final {} {
	set stats [open $::lusers_setting(page) w]
	foreach i [array names ::lusers_lusers_data] { puts $stats "   [lusers_rcodes $::lusers_lusers_data($i)]   " }
	close $stats
	foreach a [array names lusers_lusers_data] { unset lusers_lusers_data($a) }
}
proc lusers_update {} {
	putserv "LUSERS"
	if {[lsearch -glob [utimers] "* lusers_update *"] == -1} { utimer $::lusers_setting(timer_update) lusers_update }
}
It writes: http://www.shellportal.de/~msc/lusers.txt this to a txt file, but I want to put the file on a website, and work with php to get the current online users etc, so I can print them on a website by using; $lusers_online (for example).
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is best suited for a PHP discussion forum.

However, here are a few poiters.

Lookup the usage (witht the handy examples and pointers to related functions) of:
fopen
fgets
fpassthru
Locked