PHP Gbox Statistic v2.2
========================

PHP Gbox Statistic is a program to show statistics about connected Peers and general statistic information from a running gbox. It also include the possibility to create or edit cwshare.cfg and gbox_cfg. It comes completely with a Webserver/PHP Server/Webbrowser Suite. The whole package works as a standalone version. Just install (unpack) and start it! Nothing will be written into the registry or somewhere else. All needed files are located in the directory even a mini webbbrowser.

Components included
- Webserver : Apache HTTP Server 1.3.34
- PHP Version : 5.1.2
- Webbrowser : MiniBrowser v1.1.81a

PGS will need and use the file ident.info which reflects Card/Providername to CardID. A predefined one is delivered but you can ofcourse use your own. Just replace the file in the root directory or PGS.


Installation
============
Execute "PHP Gbox Statistic VX.X.exe" and choose installation directory, e.g. "C:\Program Files\PHP Gbox Statistic" and click on Install.

Upgrade
=======
This Version 2.1 needs to be installed from scratch, no upgrade path. Also the profiles needs to be created again because the entries are now encrypted in the profile files. Also new libraries are included for ssh support.


Configuration
=============
1. No need to edit pgs.ini anymore. There is a new menu "Profile" where configurations for several boxes can be added, deleted and changed. Use only this item to configure your devices.


2. pms_config.ini
Normally this file doesn't need to be touched. What you can change is the port you want the webserver to run on or if you want to use a different browser than MiniBrowser which comes with this package.


--- Defines the port that should be used. If this port is in use a unused
--- port will be searched automatically
Port=4001

--- The browser that is started after server start (possible values: IEXPLORER, FIREFOX, MOZILLA, DEFAULT, EXTERNAL)
BrowserType=EXTERNAL


--- Path to an external browser that is used instead the browser above
BrowserPath=MiniBrws32/MiniBrws32.exe



Usage
=====
Start PHP Gbox Statistic with PGS.exe. The Webserver/PHP Server/Webbrowser will be started automatically and the Main page of this application will be shown. A few seconds after exiting the browser, the webserver/PHP Server will be shutdown automatically. No need to stop it manually.


1. Home
Return to the Main Page

2. Profile
Use this to create, edit and delete profiles. If you create a new profile, the fields are prefilled with values. You can then change the entries depending on your configuration. The profile to be used can be selected on the main page.
Now Profile names can be given to the different profiles. All entered information are encrypted on harddisk.

3. Load Data
Load share.onl, share.info and if available online.log and atack.txt via ftp or load it from a local directory. PGS won't automatically reread the data periodically. You have to reread it manually if you want the updated files.


4. User Stats
This gives you a list of peers and shows you who is online or offline. There are three status colors :

green	This user is online
red	This user if offline
blue	This user has cards in share.info but share.onl shows him as offline.

Also it will display how many cards are shared by them and some additional information about the peers. Notice that no cards will be shown with Distance greater than 5. I believe most of the users out there are using option I: { } with a value smaller than 5.

Use the pulldown menu to sort by the different columns like Username (default selection), IP Address, BoxID, Gbox Version and Number of Cards).

Use the magnifier symbol at the end of the line to get detailed summary about the shared cards (Distance and Level of cards). 
The Details button shows all cards of this peer where the columns again can be sorted by Cardname,CardID, Level, Distance (default selection) and BoxID.

Possibility to add cards as G and Y lines to cwshare.cfg. To do this click on the "G" or "Y"-Symbol

The attack button shows the content of the atack.txt file. You can empty it with the Empty-Button

The onlinelog button shows the content of share.onl and online.log


5. Total Stats
This gives you an overview about all cards and a sum of the cards for every provider, independent from the peer.

Possibility to add a provider to ignore.list directly.

Details lists all cards where the columns again can be sorted by Cardname, CardID , Username, Level, Distance (default selection) and BoxID.
Use the magnifier symbol at the end of the line to get all peers who have the card with all details, again sortable.

Possibility to add cards as G and Y lines to cwshare.cfg. To do this click on the "G" or "Y"-Symbol

Level 0 shows you all cards with Level = 0. On the right top of this menu you can click Y lines to generate Y lines for all those Level 0 cards. You can directly add them as Y lines to cwshare.cfg. It will also add the Cardname and CardID as comment to the end of the line.


You can also enter a BoxID to search for.



6. Config
Here you can create cwshare.cfg and gbox_cfg or edit your existing ones. There are two icons for each with different functionality :
- Edit with help of a form .. you can begin from scratch or load an existing file
- Load the existing file into an editor to change everyting manually elah mad

When saving the files to your keys directory, the old file will be backuped with the .save extension and for cwshare.cfg a local backup will be done in the <PGS directory>/htdocs/tmp/backup/cwshare.cfg.<date>.<time>.<server>

There is also a possibility to edit the ignore.list and the key files (crypto,conax,irdeto,nagra,seca,via). The files are loaded into an editor can can be changed and saved back to the device.


7. Tools
This Menu is new to PGS version 2.X

- Control :
For Gemini Images you can reset your cam. For SSH Server you can start, stop and restart gbox.

- OptiG (Works only with a Receiver and FTP Mode) :
This option can be used to optimize the G lines for cwshare.cfg. Everytime a channel can be encrypted, a file called ecm.info is written into the tmp directory. PGS makes use of this nice feature. What does it mean if a channel can be encrypted ? Of course, this means the BoxID which could encrypt the channel is good and can be used as G line.

How does OptiG works ? To start the optimization, you have to use "Optimize". After choosing this option, you can zap the channels. Every successful decode with result in a G line with the ProviderID and the BoxID of the "good" card to be written into a file called ../htdocs/tmp/optimize.txt. The ecm.info file will be loaded every 10 seconds. So zap on every channel for at least 10 seconds be be sure that OptiG recognized it. To stop the optimization, press the "Stop"-Button. This will stop the optimization and the collected G lines are shown. You can the cut & paste them all or selected ones into cwshare.cfg and restart gbox.

- OptiY (Works only with a Receiver and FTP Mode) :
This option can be used to optimize the Y lines for cwshare.cfg. 

How does OptiY works ? It could happen that you switch to a channel and that channel could not be decrypted even you have cards for that provider in your share. What does it mean ? They are all "bad" cards. So you can put them all as Y lines into cwshare.cfg to block them. If they are blocked, you might get other "good" cards which do not reach your share due to the X restrictions. If your channel stays black, turn on OptiY, choose the Provider from the list of the cards you receive. All available cards for that provider will be shown as Y lines ready to cut and paste into your cwshare.cfg. Don't forget to restart gbox. 

- TestPeer
TestPeer makes a backup of your current cwshare.cfg, disables all lines and you can choose which peer (also several peers) you want to enable alone. You can also choose a new I and X. After testing you can redo the everything with only one click.


8. About
Information about the current version of PHP Gbox Statistc and the packaged WebServer/PHP Server/Webbrowser components. 



(c) 2006 Maverick26
