WebStats / WebChat
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

WebStats / WebChat

Started by Etaipo, 17 May, 2004, 21:09:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Etaipo

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

plop

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 <----<<

Etaipo

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.

plop

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 <----<<

Etaipo

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?

plop

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 <----<<


plop

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
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 <----<<

Pedja

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

damn I am bored with the beta - debug versions ...

try using TD4

Psycho_Chihuahua

#10
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


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
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

#11
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 ^^
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

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

SMF spam blocked by CleanTalk