PtokaX forum

PtokaX => FAQ section => Topic started by: Etaipo on 17 May, 2004, 21:09:04

Title: WebStats / WebChat
Post by: Etaipo on 17 May, 2004, 21:09:04
Hello there.

I don't know that this is the right place to post this question, but it was the most likely forum that I could find.

So I'm looking through the Ptokax folder, and I see the html folder, and the templates contained therein.  The webserver.txt file is of absolutely no help, but the potential there is intriguing.

So my question is this:

I want to serve up some VERY minimal webstats regarding my hub, such as current # of users, sharesize, and maybe one or two other things.  Maybe even have the chat, though I'm not sure about that.

Could someone instruct me on what I need to do, or provide an example?  Use the MINIMAL example, of just a simple, plain page, displaying:

Current number of users:
Sharesize:

The second part of my question is does Ptokax have it's on webserver (which it appears to do).  Where do I put the files to let that webserver serve them up.  Can I use a different webserver and still access the stats?  Can I use a different webserver on another machine and still access the stats?

Any help would be very much appreciated.

E
Title:
Post by: plop on 18 May, 2004, 00:12:25
just enable it on the console and connect 2 the port it's running on with a browser, can't make it more complex then this.

plop
Title:
Post by: Etaipo on 18 May, 2004, 00:54:44
i meant what html code is needed?

after examining the examples included, it seems you have to have files both in the html folder, and in the templates folder, and they have to match?

there is no documentation that i can find that explains how you need to code the html to display the stats, other than this...

QuoteThere are two directories: templates and webstats.

In the webstats directory, all kind of gfx, static-html, etc. ... is stored.
The templates directory contains the html-files with tags/placeholders.

The Webserver is looking for tags like:

<--USERCOUNT-->      //current amount of users in the hub
<--SHARESIZE-->      //Sharesize in GB
<--ACTIP-->         //actual hub-adress
<--SHARELIMIT-->      // Set sharelimit in the hubsoftware
<--SHARELUNIT-->      //unit of the set limit
<--MINSLOTS-->      //minimum open slots set in Hubsoftware
<--MAXHUBS-->         //max. number of simultaneous hubs
<--MAXNOCLIENTS-->      //max. Number of allowed Users on the hu
<--CHATLINE0-->      //most recent chat-line
...            //former chat-lines
..            //former chat-lines
<--CHATLINE14-->      //oldest chat-line


In common html-editors its enough to insert a text/tag like <--USERCOUNT-->. But its important, that in the real souce of the page, the < is replaced by < and > is replaced by >


If a request of a client occurs, the webserver parses all html-files in the templates directory and puts the result in webstats. Therefore it would be possible to use the stuff in webstats as cache.


One possible - and maybe common - scenario:

You run a regular webserver on port 80. And you want to include some statistics into the existing page. The most simple way is to build on a frameset. That means: Only a Frame of the regular Webserver redirects to the Hub-Webserver. Realized by doing (if hub-webserver runs on port 8080:



This will insert the page index.html (in the webstats directory) into your common Homepage. Inside the frame the user can navigate in the known way.

But take care: every file, that shall contain Live-Statistics, needs to be placed in the templates-directory. The Hub-webserver copies them on client-browser-request to the webstats directory. So a link must go there.

If this explanation isnt enough, just have a look at the provided example - and never mind to ask the dev-team of ptokax.

i wouldn't call that self-explanatory.
Title:
Post by: plop on 18 May, 2004, 02:35:02
they way it is in the zip it allready works.
the templates are empty files which you can alter 2 give it your own look.
if you open the html files in notepad you'll see the tags from the docs.
those are procest by ptokax before it sends the html 2 the user.

plop
Title:
Post by: Etaipo on 20 May, 2004, 06:47:50
Ok, got it functioning.

Now, another question:

Are these all the tags available?  If not, is there a complete list somewhere?

Quote<--USERCOUNT--> //current amount of users in the hub
<--SHARESIZE--> //Sharesize in GB
<--ACTIP--> //actual hub-adress
<--SHARELIMIT--> // Set sharelimit in the hubsoftware
<--SHARELUNIT--> //unit of the set limit
<--MINSLOTS--> //minimum open slots set in Hubsoftware
<--MAXHUBS--> //max. number of simultaneous hubs
<--MAXNOCLIENTS--> //max. Number of allowed Users on the hu
<--CHATLINE0--> //most recent chat-line
... //former chat-lines
.. //former chat-lines
<--CHATLINE14--> //oldest chat-line

Also, how do you do a timestamp?
Title:
Post by: plop on 20 May, 2004, 12:44:57
all the things which are avail are in that docs file, but there are tricks 2 get more things.
for example i'm using a script running on ptokax 2 generate everything i found missing.
but you can also use some of the log/settings files from ptokax that way.
wooshman made something like that also.
but easy is something else. lol
but 2 give you an idea i gave my webstats more then 3x as much info as ptokax could.

plop
Title:
Post by: Snooze on 26 June, 2004, 02:05:31
Any chance of you sharing those ideas, plop ?
Title:
Post by: plop on 26 June, 2004, 03:27:37
QuoteOriginally posted by Snooze
Any chance of you sharing those ideas, plop ?
it's part of a.i. and can't realy be stripped from it.
i made it in the past when i had some free time just never came 2 the point of debugging it.
1 script restart with users in the hub and it screws up.
it consists of 3 parts:
1) the logs from a.i.
2) the userinfo database from a.i.
3) chat/user stats, this looks a lot like the user counter i made a while back.
but 2 make it worse there is more tricky stuff, it doesn't use html/php/cgi.
it needs apache 1.3.x with the mod_lua, a.k.a. lhtml.
and 2 finish it, last time i checked it doubled the amount of resources (3x @least by now as i done a whole lot of optimizing) of a.i..

but you should now have an idea how 2 make something like this yourself, a lot of nice things can be done with the logfiles.

plop
Title:
Post by: Pedja on 08 October, 2004, 01:44:01
I just downloaded and installed Ptokax but i did not find anything related to generating web statistics (tehre are no directories you are mentioning.

Where can I get them? It seems official web site is down.
Title:
Post by: Herodes on 08 October, 2004, 02:16:05
damn I am bored with the beta - debug versions ...

try using TD4 (http://www.plop.nl/ptokax/PtokaX-0.326.TestDrive4.zip)
Title:
Post by: Psycho_Chihuahua on 08 October, 2004, 03:07:06
QuoteOriginally posted by Mutor
the inbuilt web server was quite weak, and very limited.
If you have your own web server with CGI support. You can do hubstats by Wooshman.
I added a few requests to it, and also chat history. Check it out.
I cannot seem to find the original post. Oh well.

Hubstats Demo (http://mutor.no-ip.com:444/cgi-bin/hub.cgi)


Download the script package here... (http://mutor.no-ip.com:457/images/hubstats2.rar)
could you add an optional Background Image in settings?

would be a lot easier to change it around  :D

thnx
Title:
Post by: Psycho_Chihuahua on 08 October, 2004, 18:51:40
cool thnx

1 more little thing...

Is it supposed to show the
"return {" and the "}" as well in Chat history? Opticaly it would be nicer without. but otherwise a super script and i'm using it myself ^^
Title:
Post by: Psycho_Chihuahua on 12 October, 2004, 01:39:39
well what would i have to add to the code to have it split registered users into 4 columns?

i have 150 registered users and it wouldgo niceley on 1 page without the need to scroll if it would show  in 4 columns

like one used to to with Dos
C:\>dir /w /p or something like that

hope u get the drift ^^