Palview4 Manual  *   The Palview Pages  *   The Palview Developers Forum  *   Home  *   Palamede

The Palview Utility Program


One of the more difficult tasks for a web-based chess magazine is the creation of crosstables. Palview has a number of options that allow you to create crosstables from the games in a PGN file. But sometimes you just want to report the results of a tournament without having to put together all the games in a PGN file and get Palview to create a fully linked table. Sometimes you just want a picture of the crosstable. But creating the Html for such a table is really a boring and mechanical task -- something best suited for a program. This is why the new Palview Utility program was created.

You pass the Utility program a simple text file containing a simplified text version of your crosstable(s). You can also pass it an INI file along with the text file. The INI file will be read in order to obtain the settings for the INI commands: flags, flagurl, and crosstablecss, all of which are used by the Utility program to create an Html file that can be inserted (or copy / pasted) into your own Html files.

You should also note that all the CSS properties that apply to Palview's usual crosstables also apply to the crosstables created by the new Utility program. For more information on crosstables and CSS, please see Crosstables and CSS.

The new Utility program reads a simple text file and outputs an Html file. The text file contains a simplified text version of your crosstable. The first line must contain the keyword cross. This is required in order to tell the program what kind of transformation you want. In this case, you want to create a crosstable. (We may add other transformations to the program in the future to assist webmasters.) After the cross keyword you need to tell the program the number of columns in your crosstable using cols=N. You can also optionally provide a Category for your crosstable using the command cat=N.

The second line of your crosstable text is for the heading. Here you would typically include the name of the Event, the Site and the Date. The Utility program will look for the first comma in the line and use all the text before it to form an Html anchor that it writes just before the crosstable. For example, if the heading line of your crosstable was:

Match, Albert FRA 2001 

Then the Utility program would write the following Html before the crosstable:

<A NAME='pcross_Match'></A>

The next line is for the Round numbers and the Totals columns. You can see an example of this below.

All subsequent lines are for the player's and their results in the tournament. Below is the simplified text for a match and the Html created by the program from it.

cross cols=15
Match, Albert FRA 2001 
       |  |    |    | | 1 2 3 4 5 6 | = |    |   
Sutovsky GM  ISR 2664 |   0   1 | 3 | 2653 
Bacrot   GM  FRA 2653 |   1   0 | 3 | 2664

The Palview Utility program reserves a few characters for special use in creating the simplified text for your crosstables. The pipe character '|' is reserved as a special empty column marker. Whenever the program encounters this, it will generate a simple empty column using: <TD>&nbsp;</TD>. Notice that all empty space between column contents is ignored. Because you will sometimes have column contents that has embedded spaces, the Utility program reserves the characters '{' and '}' to surround any contents with embedded spaces. An example might be a player's full name, as in:

{Kasparov, Garry} GM RUS ...

The Utility program treats certain column content as special. For example, the first column of every player row is assumed to contain the name of the player. In this case, the program will apply the special CSS class pplay to the name. For example:

<TD class='pplay'>Kasparov</TD>

(NOTE: This first column can optionally be a number instead, in which case the player name class, pplay will not be used and the next column will be examined for a player name.)

Following the player's name, the program will examine the next few columns for a player's Title, Country, and Elo. The Utility program recognizes the following Titles:

IM, FM, GM, WM, WG, M, CC-GM, CC-SIM, CC-LGM, CC-LM

If the program recognizes a Title it will apply the special CSS class ptitle as in this example:

<TD class='ptitle'>GM</TD>

The Utility program also looks for any three-letter Country code within the first three columns after a player's name. If such a code is found, the program may convert this code to a country flag image. (As can be seen in the example images.) Whether or not flag images are to be used is determined by the INI setting: flags. If the program is to use the flags, then it will use the value provided by the INI option flagurl to determine where the flag images are kept. (For more information on Countries and their codes, please see The Palview Flags.)

Finally, any numeric value between 1000 and 3000 that appears within the first three columns after a player's name is treated by the program as an Elo rating. The program will apply the special CSS class, pelo, to such a rating, as in this example:

<TD class='pelo'>2845</TD>

All other column content is inserted directly into the table as is without any special CSS classes applied.

One final note. When a Category is provided, using the cat=N option, the program will write the Category number in Roman numerals at the end of the Heading row. For example, here is the simplified text for such a crosstable:

cross cols=17 cat=19
Dortmund, Germany 1999
      |  |    |    | | 1 2 3 4 5 6 7 8 | =  |     |    
Leko    GM  HUN 2701 | x    1  1 1 | 5  |  2863 
Kramnik GM  RUS 2760 |  x     1 1 | 4 |  2798 
Karpov  GM  RUS 2700 |   x   1   | 4  |  2755 
Anand   GM  IND 2771 |    x    1 | 4  |  2745 
Adams   GM  ENG 2708 | 0    x  1 1 | 4  |  2754 
Sokolov GM  BIH 2656 |   0   x 0  | 2 |  2609 
Topalov GM  BUL 2690 | 0 0   0 1 x 0 | 2  |  2548 
Timman  GM  NED 2650 | 0 0  0 0  1 x | 2  |  2554

Below is an example of the above crosstable converted by the Utility program.

We may eventually find other tabular type information that this program can assist in making. One example may be an ECO Table template, the kind of thing you see in so many chess opening books. If you can think of any other such things just let us know!