Author Topic: WebStats / WebChat  (Read 4678 times)

0 Members and 1 Guest are viewing this topic.

Offline Etaipo

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
WebStats / WebChat
« 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

PtokaX forum

WebStats / WebChat
« on: 17 May, 2004, 21:09:04 »

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #1 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Etaipo

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
(No subject)
« Reply #2 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...

Quote
There 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.

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #3 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Etaipo

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
(No subject)
« Reply #4 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?

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #5 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Snooze

  • Scripter
  • Viking
  • ******
  • Posts: 606
  • Karma: +54/-3
    • DiXBoT Website
(No subject)
« Reply #6 on: 26 June, 2004, 02:05:31 »
Any chance of you sharing those ideas, plop ?

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #7 on: 26 June, 2004, 03:27:37 »
Quote
Originally 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Pedja

  • Junior Member
  • **
  • Posts: 14
  • Karma: +0/-0
(No subject)
« Reply #8 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.

Herodes

  • Guest
(No subject)
« Reply #9 on: 08 October, 2004, 02:16:05 »
damn I am bored with the beta - debug versions ...

try using TD4

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Emperor
  • **
  • Posts: 1 054
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
(No subject)
« Reply #10 on: 08 October, 2004, 03:07:06 »
Quote
Originally posted by American Idiot
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


Download the script package here...
could you add an optional Background Image in settings?

would be a lot easier to change it around  :D

thnx
« Last Edit: 08 October, 2004, 03:08:05 by Psycho_Chihuahua »
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Emperor
  • **
  • Posts: 1 054
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
(No subject)
« Reply #11 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 ^^
« Last Edit: 08 October, 2004, 19:49:56 by Psycho_Chihuahua »
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Emperor
  • **
  • Posts: 1 054
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
(No subject)
« Reply #12 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 ^^
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

PtokaX forum

(No subject)
« Reply #12 on: 12 October, 2004, 01:39:39 »