more consistent tournaments names management
[brisk.git] / web / index.php
1 <?php
2 /*
3  *  brisk - index.php
4  *
5  *  Copyright (C) 2006-2015 Matteo Nastasi
6  *                          mailto: nastasi@alternativeoutput.it
7  *                                  matteo.nastasi@milug.org
8  *                          web: http://www.alternativeoutput.it
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details. You should have received a
19  * copy of the GNU General Public License along with this program; if
20  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
21  * Suite 330, Boston, MA 02111-1307, USA.
22  *
23  */
24
25 require_once("Obj/user.phh");
26 require_once("Obj/brisk.phh");
27 require_once("Obj/auth.phh");
28
29 $mlang_room = array( 'userpassuse'  => array('it' => 'Il tuo nickname &egrave; gi&agrave; in uso.',
30                                              'en' => 'Your nickname is already in use.'),
31                      'userpassend'  => array('it' => 'Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.',
32                                              'en' => 'We are sorry, there aren\'t free place. Try again later.'),
33                      'userpassmust' => array('it' => 'Il nickname deve contenere almeno una lettera o una cifra.',
34                                              'en' => 'The nickname have to contain at least one letter or one number.'),
35                      'userpasserr'  => array('it' => 'Utente e/o password errati.',
36                                              'en' => 'Wrong user and/or password.'),
37                      'userpassban'  => array('it' => 'Il tuo indirizzo IP è stato bannato perché precedentemente utilizzato da qualche molestatore.',
38                                              'en' => 'Your IP address is banned because trolling activity was detected from it.'),
39                      'standing'     => array('it' => 'Giocatori in piedi',
40                                              'en' => 'Standing players'),
41                      'headline'     => array('it' => 'briscola chiamata in salsa ajax',
42                                              'en' => 'declaration briscola in ajax sauce <b>(Beta)</b>'),
43                      'welcome'      => array('it' => 'Digita il tuo nickname per accedere ai tavoli della briscola.',
44                                              'en' => 'Enter your nickname to access to the tables of briscola.'),
45                      'reas_unkn'    => array('it' => 'Logout per motivi sconosciuti.',
46                                              'en' => 'Logout with unknown reason.'),
47                      'reas_lout'    => array('it' => 'Orevoire.',
48                                              'en' => 'EN Orevoire.'),
49                      'reas_tout'    => array('it' => 'Abbiamo perso le tue tracce, quindi ti abbiamo disconnesso.',
50                                              'en' => 'EN Abbiamo perso le tue tracce, quindi ti abbiamo disconnesso.'),
51                      'reas_ttot'    => array('it' => 'Abbiamo perso le tue tracce mentre stavi giocando, quindi ti abbiamo disconnesso.',
52                                              'en' => 'EN Abbiamo perso le tue tracce mentre stavi giocando, quindi ti abbiamo disconnesso.'),
53                      'reas_anon'    => array('it' => 'L\' accesso attraverso sistemi di anonimizzazione non è consentito.',
54                                              'en' => 'EN L\' accesso attraverso sistemi di anonimizzazione non è consentito.'),
55                      'reas_prox'    => array('it' => 'L\' accesso attraverso proxy non è consentito, se lo usi solo tu e pochi altri utenti comunica il suo indirizzo IP all\' <a href="mailto: brisk@alternativeoutput.it">amministratore</a> per aggiungerlo alle eccezioni.',
56                                              'en' => 'EN L\' accesso attraverso proxy non è consentito, se lo usi solo tu e pochi altri utenti comunica il suo indirizzo IP all\' <a href="mailto: brisk@alternativeoutput.it">amministratore</a> per aggiungerlo alle eccezioni.'),
57                      'reas_anot'    => array('it' => 'La tua sessione è stata assegnata ad un altro browser.',
58                                              'en' => 'EN La tua sessione è stata assegnata ad un altro browser.'),
59                      'reas_cloud'   => array('it' => 'La connessione dai computer di una cloud non è ammessa.',
60                                              'en' => 'Connection from cloud computers is not allowed.'),
61
62                      'btn_enter'    => array('it' => 'Entra.',
63                                              'en' => 'Enter.'),
64                      'passwarn'     => array('it' => 'Se non hai ancora una password, lascia il campo in bianco ed entra.',
65                                              'en' => 'If you don\'t have a password, leave blank the field and enter.'),
66                      'browwarn'     => array('it' => 'Se qualcosa non funziona prova a ricaricare la pagina con <b>Ctrl + F5</b><br><br>Se non riesci più ad entrare nel nuovo Brisk e prima ci riuscivi potrebbe essere un problema di antivirus,<br>guarda la <a class=\'flat\' style=\'background-color: white; font-weight: bold;\' target=\'_blank\' href=\'http://www.alternativeoutput.it/blog/doku.php?id=brisk:guida_agli_antivirus\'>pagina sugli antivirus</a> per maggiori informazioni su come configurarlo.<br><br>Se ancora non funziona nulla contatta <a class=\'flat\' style=\'background-color: white; font-weight: bold;\' href=\'mailto:brisk@alternativeoutput.it\'>l\'amministratore del sito</a>.',
67                                              'en' => '(if something don\'t work<br>try to reload the current page with <b>Ctrl + F5</b>)'),
68                      'regwarn'      => array('it' => '<br>Il nickname che stai usando &egrave; gi&agrave; registrato,<br><br>se il suo proprietario si autentificher&agrave;<br><br>verrai rinominato d\'ufficio come ghost<i>N</i>.',
69                                              'en' => '<br>The nickname you are using it\'s already registered, <br><br>if its proprietary authenticates<br><br>you will named ghost<i>N</i>.'),
70                      'btn_rettabs'  => array('it' => 'torna ai tavoli',
71                                              'en' => 'back to tables'),
72                      'btn_exit'     => array('it' => 'Esco.',
73                                              'en' => 'Exit.'),
74                      'btn_save' => array('it' => 'Salva.',
75                                              'en' => 'Save.'),
76                      'btn_reset' => array('it' => 'Annulla.',
77                                              'en' => 'Reset.'),
78                      'btn_close' => array('it' => 'Chiudi.',
79                                              'en' => 'Close.'),
80                      'btn_send'  => array('it' => 'Invia.',
81                                              'en' => 'Send.'),
82                      'tit_tabl'     => array('it' => 'Tavolo ',
83                                              'en' => 'Table '),
84                      'tit_stat'     => array('it' => 'imposta lo stato del tuo utente',
85                                              'en' => 'set the status of the user'),
86                      'stat_desc'    => array('it' => 'stato',
87                                              'en' => 'mode' ),
88                      'st_norm_desc' => array('it' => 'normale',
89                                              'en' => 'normal'),
90                      'st_paus_desc' => array('it' => 'pausa',
91                                              'en' => 'pause'),
92                      'st_out_desc'  => array('it' => 'fuori',
93                                              'en' => 'out'),
94                      'st_dog_desc'  => array('it' => 'cane',
95                                              'en' => 'dog'),
96                      'st_food_desc' => array('it' => 'cibo',
97                                              'en' => 'food'),
98                      'st_work_desc' => array('it' => 'lavoro',
99                                              'en' => 'work'),
100                      'st_smok_desc' => array('it' => 'sigaretta',
101                                              'en' => 'smoke'),
102                      'st_pres_desc' => array('it' => 'presente',
103                                              'en' => 'present'),
104                      'st_rabb_desc' => array('it' => 'coniglio',
105                                              'en' => 'rabbit'),
106                      'st_socc_desc' => array('it' => 'calcio',
107                                              'en' => 'soccer'),
108                      'st_baby_desc' => array('it' => 'pupo',
109                                              'en' => 'baby'),
110                      'st_mop_desc'  => array('it' => 'pulizie',
111                                              'en' => 'mop'),
112                      'st_babbo_desc'  => array('it' => 'babbo',
113                                              'en' => 'mop'),
114                      'st_renna_desc'  => array('it' => 'renna',
115                                              'en' => 'mop'),
116                      'st_pupaz_desc'  => array('it' => 'pupazzo',
117                                              'en' => 'mop'),
118                      'st_visch_desc'  => array('it' => 'vischio',
119                                              'en' => 'mop'),
120
121                      'tit_ticker'   => array('it' => 'scrivi un invito al tavolo e clicca',
122                                              'en' => 'write an invitation at the table and click'),
123                      'itm_warr'     => array('it' => 'garantisci',
124                                              'en' => 'guarantee'),
125                      'warr_desc'    => array('it' => 'garantisci per un tuo conoscente',
126                                              'en' => 'guarantee for a friend'),
127                      'tit_warr'     => array('it' => 'Garantisci per un tuo conoscente.',
128                                              'en' => 'Guarantee for a friend.'),
129                      'itm_list'     => array('it' => 'ascolta',
130                                              'en' => 'listen'),
131                      'list_desc'    => array('it' => 'imposta le regole di ascolto',
132                                              'en' => 'set the listen rules'),
133                      'tit_listall'  => array('it' => 'tutti',
134                                              'en' => 'everybody'),
135                      'listall_desc' => array('it' => 'leggi tutti i messaggi di tutti gli utenti collegati',
136                                              'en' => 'listen all messages from each user connected'),
137                      'tit_listaut'  => array('it' => 'solo autenticati',
138                                              'en' => 'only authorized'),
139                      'tit_listisol'  => array('it' => 'isolamento',
140                                              'en' => 'isolation'),
141                      'listaut_desc' => array('it' => 'leggi soltanto i messaggi degli utenti con password',
142                                              'en' => 'listen messages only from authenticated users'),
143                      'listisol_desc'=> array('it' => 'visualizza Brisk come se fosse solo per utenti con password',
144                                             'en' => 'show Brisk like an authenticated user only site'),
145                      'suppcomp_tit' =>  array('it' => 'personalizza la tua S',
146                                             'en' => 'customize your S'),
147                      'suppcomp_r' =>  array('it' => 'rosso',
148                                             'en' => 'red'),
149                      'suppcomp_g' =>  array('it' => 'verde',
150                                             'en' => 'green'),
151                      'suppcomp_b' =>  array('it' => 'blu',
152                                             'en' => 'blue'),
153                      'suppcomp_fg' =>  array('it' => 'colore',
154                                             'en' => 'color'),
155                      'suppcomp_bg' =>  array('it' => 'sfondo',
156                                             'en' => 'background'),
157                      'suppcomp_range' =>  array('it' => '(0-255)',
158                                             'en' => '(0-255)'),
159                      'tit_splash'   => array('it' => 'splash',
160                                              'en' => 'splash'),
161                      'splash_desc'  => array('it' => 'attiva la finestra di splash',
162                                              'en' => 'show the splash window'),
163                      'tit_prefs'   => array('it' => 'preferenze',
164                                              'en' => 'preferences'),
165                      'prefs_desc'  => array('it' => 'preferenze dell\' utente',
166                                              'en' => 'user\'s preferences'),
167                      'tit_help'     => array('it' => 'informazioni utili su Brisk',
168                                              'en' => 'usefull information about Brisk'),
169                      'itm_help'     => array('it' => 'aiuto',
170                                              'en' => 'help'),
171                      'tit_hpage'    => array('it' => 'homepage del progetto',
172                                              'en' => 'project homepage (ita)'),
173                      'tit_what'     => array('it' => 'di cosa si tratta',
174                                              'en' => 'what is the project'),
175                      'itm_what'     => array('it' => 'cos\'&egrave;',
176                                              'en' => 'what is it'),
177                      'url_rules'    => array('it' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5',
178                                              'en' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5&EN=true'),
179                      'itm_rules'    => array('it' => 'regole',
180                                              'en' => 'rules'),
181                      'tit_rules'    => array('it' => 'come si gioca',
182                                              'en' => 'how to play'),
183                      'tit_shot'     => array('it' => 'screenshots dell\'applicazione',
184                                              'en' => 'screenshots of the web-application'),
185                      'tit_comp'     => array('it' => 'compatibilit&agrave; con i browser',
186                                              'en' => 'browsers compatibility'),
187                      'itm_comp'     => array('it' => 'compatibilit&agrave;',
188                                              'en' => 'compatibility'),
189                      'tit_src'      => array('it' => 'sorgenti dell\'applicazione web',
190                                              'en' => 'sources of the web-application'),
191                      'itm_src'      => array('it' => 'sorgenti',
192                                              'en' => 'sources'),
193                      'tit_ml'       => array('it' => 'come iscriversi alla mailing list',
194                                              'en' => 'how to subscribe the mailing list'),
195                      'itm_ml'       => array('it' => 'mailing&nbsp;list',
196                                              'en' => 'mailing&nbsp;list'),
197                      'tit_pro'      => array('it' => 'come fare pubblicit&agrave; a Brisk!',
198                                              'en' => 'how to spread Brisk!'),
199                      'itm_pro'      => array('it' => 'propaganda',
200                                              'en' => 'propaganda'),
201                      'tit_mail'     => array('it' => 'contatti',
202                                              'en' => 'contacts'),
203                      'itm_mail'     => array('it' => 'contatti',
204                                              'en' => 'contacts'),
205                      'tit_cook'      => array('it' => 'policy sui cookie',
206                                               'en' => 'cookie policy'),
207                      'itm_cook'      => array('it' => 'cookie',
208                                               'en' => 'cookie'),
209                      'tit_cla'      => array('it' => 'classifiche degli utenti',
210                                              'en' => 'user\'s placings'),
211                      'itm_cla'      => array('it' => 'classifiche',
212                                              'en' => 'placings'),
213                      'tit_mnu'      => array('it' => 'minuta giornaliera',
214                                              'en' => 'daily report'),
215                      'itm_mnu'      => array('it' => 'minuta',
216                                              'en' => 'daily deport'),
217                      'tit_rmap'     => array('it' => 'prossime funzionalità implementate',
218                                              'en' => 'roadmap of next functionalities'),
219                      'itm_rmap'     => array('it' => 'roadmap',
220                                              'en' => 'roadmap'),
221                      'tit_meet'     => array('it' => 'foto dei raduni di briskisti (serve Facebook)',
222                                              'en' => 'photos of brisk meetings'),
223                      'itm_meet'     => array('it' => 'BriskMeeting',
224                                              'en' => 'BriskMeeting'),
225                      'tit_mesg'     => array('it' => 'manda un messaggio o una segnalazione all\'amministratore del sito',
226                                              'en' => 'send a message or a signalling to the administrator' ),
227                      'mesgtoadm_tit'=> array('it' => 'Invia un messaggio o una segnalazione all\'amministratore:',
228                                              'en' => 'Send a message to the administrator:'),
229                      'mesgtoadm_sub'=> array('it' => 'soggetto:',
230                                              'en' => 'subject:'),
231                      'info_login' => array('it' => 'Utente',
232                                           'en' => 'User'),
233                      'info_status' => array('it' => 'Stato',
234                                           'en' => 'Status'),
235                      'info_status_tit' => array('it' => 'Stato dell\' utente.',
236                                           'en' => 'User status.'),
237                      'info_guar' => array('it' => 'Garante',
238                                           'en' => 'Guarantee'),
239                      'info_match' => array('it' => 'Partite',
240                                            'en' => 'Matches'),
241                      'info_match_tit' => array('it' => 'Partite giocate ai tavoli riservati.',
242                                            'en' => 'Matches played at reserved tables.'),
243                      'info_party' => array('it' => 'Party',
244                                            'en' => 'Party'),
245                      'info_party_tit' => array('it' => 'Bravura calcolata in base ad amici, agli amici fidati e agli amici degli amici fidati in base alla credibilità degli amici fidati.',
246                                            'en' => 'Skill calculated with party rules.'),
247                      'info_game' => array('it' => 'Mani',
248                                           'en' => 'Hands'),
249                      'info_game_tit' => array('it' => 'Mani giocate ai tavoli riservati.',
250                                               'en' => 'Hands played at reserved tables.'),
251                      'info_frie' => array('it' => 'Conoscenza:',
252                                           'en' => 'Friendship:'),
253                      'info_repfrie' => array('it' => 'Cosa ne pensano gli amici',
254                                              'en' => 'Friends reputation'),
255                      'info_repbff' => array('it' => 'Cosa ne pensano gli amici fidati',
256                                             'en' => 'Best friends reputation'),
257                      'info_skill' => array('it' => 'Bravura',
258                                             'en' => 'Skill')
259                      );
260
261 require_once("briskin5/Obj/briskin5.phh");
262
263 function poll_dom()
264 {
265     GLOBAL $G_with_poll, $G_poll_title, $G_poll_entries;
266
267     if ($G_with_poll) {
268         $ret = sprintf('<div style="padding: 0px;margin: 0px; height: 8px; font-size: 1px;"></div>
269
270 <img class="nobo" src="img/brisk_poll.png" onmouseover="menu_hide(0,0); menu_show(\'menu_poll\');">
271
272 <div style="width: 300px;" class="webstart" id="menu_poll" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
273 <b>%s</b><br><br>
274 <form id="poll_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_pollbox(this);">
275 <input type="hidden" name="realsub" value="666">', $G_poll_title);
276         for ($i = 0 ; $i < count($G_poll_entries) ; $i++) {
277             $ret .= sprintf('<INPUT TYPE="radio" NAME="category" VALUE="%s">%s<hr><br>', $G_poll_entries[$i]['id'],
278                             $G_poll_entries[$i]['cont']);
279         }
280         $ret .= sprintf('<div style="text-align: center;"><input type="submit" class="input_sub" onclick="this.form.elements[\'realsub\'].value = this.value;" value="invia" name="sub" id="subid"/></div>
281 </form></div>');
282         return ($ret);
283     }
284     else
285         return '';
286 }
287
288 function sidebanners_init($sidebanner_idx)
289 {
290     for ($i = 0 ; $i < count($sidebanner_idx) ; $i++) {
291         printf("     sidebanner_init(%d);\n", $i);
292     }
293 }
294
295 function sidebanners_render($sidebanner, $sidebanner_idx)
296 {
297     $sb_n = count($sidebanner_idx);
298     if ($sb_n == 0) {
299         return;
300     }
301
302     if ($sb_n == 1) {
303         printf("<br><br>");
304     }
305
306     for ($i = 0 ; $i < $sb_n ; $i++) {
307         $idx = $sidebanner_idx[$i];
308         $sb  = $sidebanner[$idx];
309         if (!array_key_exists('link', $sb)
310             || !array_key_exists('title', $sb)
311             || !array_key_exists('icon_big', $sb)) {
312             continue;
313         }
314         $sb_type = (array_key_exists('type', $sb) ? $sb['type'] : 'meeting');
315         if (array_key_exists('icon', $sb)) {
316             $sb_icon = $sb['icon'];
317         }
318         else {
319             if ($sb_type == 'meeting') {
320                 if ($sb_n < 3) {
321                     $sb_icon = 'img/brisk_meeting60.gif';
322                 }
323                 else {
324                     $sb_icon = 'img/brisk_meeting35.gif';
325                 }
326             }
327             else {
328                 // no standard icon for other type of events please add them
329                 continue;
330             }
331         }
332         $sb_dx =  (array_key_exists('dx', $sb) ? $sb['dx'] : 100);
333         $sb_dy =  (array_key_exists('dy', $sb) ? $sb['dy'] : -230);
334
335         printf('<div class="sidebanner" style="background: #ffd780; border: solid 1px #ffae00; width: 60px;" id="sidebanner%d">', $i);
336         printf('<a target="_blank" href="%s">', $sb['link']);
337         printf('<img style="position: static; border: solid 0px black;" src="%s"', $sb_icon);
338         printf('  onMouseOver="show_bigpict($(\'sidebanner%d\'), \'over\', %d, %d, \'\');"', $i, $sb_dx, $sb_dy);
339         printf('  onMouseOut="show_bigpict($(\'sidebanner%d\'), \'out\', 0, 0, \'\');"', $i);
340         $tit = eschtml($sb['title']);
341         printf('  alt="%s" title="%s"></a></div>', $tit, $tit);
342         printf("\n");
343
344         $ib_class =  "";
345         if (array_key_exists('icon_big_class', $sb)) {
346             $ib_class = $sb['icon_big_class'];
347         }
348
349         printf('<img class="nobohide bordergray %s" style="z-index: 255;" id="sidebanner%d_big" src="%s">', $ib_class, $i, $sb['icon_big']);
350         printf("\n");
351     }
352 }
353
354 function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_full, $get, $post, $cookie)
355 {
356     GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all;
357     GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local;
358     GLOBAL $G_sidebanner, $G_sidebanner_idx;
359     GLOBAL $G_with_poll;
360     GLOBAL $G_lang, $G_lng, $mlang_room;
361     GLOBAL $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER, $_COOKIE;
362
363     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
364         $sess = "";
365     if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
366         unset($name);
367     else
368         log_step("LOGIN: $name");
369
370     if (($pass_private = gpcs_var('pass_private', $get, $post, $cookie)) === FALSE)
371         unset ($pass_private);
372     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
373         unset ($table_idx);
374     if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
375         unset ($table_token);
376
377     // default values
378     $_cookie_law_3party = 'true';
379     if (isset($cookie['_cookie_law_3party']))
380         $_cookie_law_3party = $cookie['_cookie_law_3party'];
381
382     $remote_addr = addrtoipv4($remote_addr_full);
383
384     $is_login = FALSE;
385     $body = "";
386     $tables = "";
387     $standup = "";
388     $ACTION = "login";
389     $last_msg = "";
390     $banned = FALSE;
391
392     if (isset($BRISK_SHOWHTML) == FALSE) {
393         $is_table = FALSE;
394         log_main("lock Brisk");
395         $curtime = time();
396
397         /* Actions */
398         if (($ghost_sess = $brisk->ghost_sess->pop($sess)) != FALSE) {
399             switch ($ghost_sess->reas) {
400             case GHOST_SESS_REAS_LOUT:
401                 $last_msg = $mlang_room['reas_lout'][$G_lang];
402                 break;
403             case GHOST_SESS_REAS_ANOT:
404                 $last_msg = $mlang_room['reas_anot'][$G_lang];
405                 break;
406             case GHOST_SESS_REAS_TOUT:
407                 $last_msg = $mlang_room['reas_tout'][$G_lang];
408                 break;
409             case GHOST_SESS_REAS_TTOT:
410                 $last_msg = $mlang_room['reas_ttot'][$G_lang];
411                 break;
412             case GHOST_SESS_REAS_ANON:
413                 $last_msg = $mlang_room['reas_anon'][$G_lang];
414                 break;
415             case GHOST_SESS_REAS_PROX:
416                 $last_msg = $mlang_room['reas_prox'][$G_lang];
417                 break;
418             default:
419                 $last_msg = $mlang_room['reas_unkn'][$G_lang];
420                 break;
421             }
422         }
423         if ($brisk->cloud_check($remote_addr)) {
424             // TODO: find a way to add a nonblocking sleep(5) here
425             $banned = TRUE;
426             $last_msg = $mlang_room['reas_cloud'][$G_lang];
427         }
428
429
430         if (validate_sess($sess)) {
431             log_main("pre garbage_manager UNO");
432             $brisk->garbage_manager(TRUE);
433             log_main("post garbage_manager");
434             if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) {
435                 if ($user->the_end == FALSE) {
436                     $brisk->sess_cur_set($user->sess);
437                     log_main("user stat: ".$user->stat);
438                     if ($user->stat == "table") {
439                         $cookies = new Cookies();
440                         $cookies->add("table_token", $user->table_token, $curtime + 31536000);
441                         $cookies->add("table_idx", $user->table, $curtime + 31536000);
442                         $header_out['cookies'] = $cookies;
443                         $header_out['Location'] = "briskin5/index.php";
444                         return TRUE;
445                     }
446                     $ACTION = "room";
447                 }
448             }
449         }
450         if (!$banned && $ACTION == "login" && isset($name)) {
451             log_main("pre garbage_manager DUE");
452
453             if (isset($pass_private) == FALSE || $pass_private == "") {
454                 $pass_private = FALSE;
455
456                 if ($brisk->ban_check($remote_addr)) {
457                     // TODO: find a way to add a nonblocking sleep(5) here
458                     $banned = TRUE;
459                     $idx = -4;
460                 }
461             }
462
463             $brisk->garbage_manager(TRUE);
464             /* try login */
465
466             if ($banned == FALSE &&
467                 ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private,
468                                           $remote_addr, $header, $cookie)) != FALSE) {
469                 $brisk->sess_cur_set($user->sess);
470                 $ACTION = "room";
471                 if ($idx < 0) {
472                     $idx = -$idx - 1;
473                     $is_login = TRUE;
474                 }
475
476                 log_legal($curtime, $remote_addr, $user, "STAT:LOGIN", '');
477
478                 // recovery lost game
479                 if ($user->stat == "table") {
480                     $cookies = new Cookies();
481                     $cookies->add("table_token", $user->table_token, $curtime + 31536000);
482                     $cookies->add("table_idx", $user->table, $curtime + 31536000);
483                     $header_out['cookies'] = $cookies;
484                     $header_out['Location'] = "briskin5/index.php";
485                     return TRUE;
486                 }
487             }
488             else {
489                 fprintf(STDERR, "POST CHECK QUI\n");
490                 /* Login Rendering */
491                 switch($idx) {
492                 case -4:
493                     $sfx = 'ban';
494                     break;
495                 case -3:
496                     $sfx = 'err';
497                     break;
498                 case -2:
499                     $sfx = 'must';
500                     break;
501                 case -1:
502                     $sfx = 'end';
503                     break;
504                 default:
505                     $sfx = 'use';
506                 }
507
508                 $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
509             }
510         }
511     }
512     /* Rendering. */
513
514     if ($BRISK_SHOWHTML == "debugtable") {
515         $ACTION = "room";
516     }
517     else if ($BRISK_SHOWHTML == "debuglogin") {
518         $ACTION = "login";
519     }
520
521     if ($ACTION == "room") {
522         $tables .= '<div class="room_tab">';
523         $tables .= '<table class="room_tab">';
524         for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
525             if ($user->is_auth() && !$user->is_appr())
526                 $i = $ii;
527             else
528                 $i = TABLES_N - $ii - 1;
529
530             if ($ii % 4 == 0) {
531                 $tables .= '<tr id = "tr_noauth'.$ii.'">';
532             }
533             if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $ii < TABLES_AUTH_N) {
534                 $tables .= '<td id = "td_noauth'.$ii.'">';
535
536                 $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
537                 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
538                 $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
539                 $tables .= '</div>';
540                 $tables .= '</td>'."\n";
541             }
542             if ($ii % 4 == 3) {
543                 $tables .= '</tr>';
544             }
545         }
546         $tables .= '</table></div>';
547
548         $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
549         $standup .= '<div class="room_ex_standup">';
550         /* MLANG: "Giocatori in piedi" */
551         // $standup .= '<div id="room_tit"><span class="room_titin"><b>Giocatori in piedi</b> - <a target="_blank" href="weboftrust.php">Come ottenere user e password</a> - </span></div>';
552         $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
553
554         $standup .= sprintf('<div id="standup" class="room_standup"></div>');
555         // MLANG Esco.
556         $standup .= '<div id="esco" class="esco"><input type="button" class="button" name="xreload"  value="Reload." onclick="act_reloadroom();"><input class="button" name="logout" value="'.$mlang_room['btn_exit'][$G_lang].'" onclick="esco_cb();" type="button"></div>';
557         $standup .= '</div></td></tr></table>';
558     }
559
560     $altout_sponsor_arr = array( array ( 'id' => 'btn_altout',
561                                          'url' => 'http://www.alternativeoutput.it',
562                                          'content' => 'img/altout80x15.png',
563                                          'content_big' => 'img/logotxt_banner.png'),
564                                  array ( 'id' => 'btn_virtualsky',
565                                          'url' => 'http://virtualsky.alternativeoutput.it',
566                                          'content' => 'img/virtualsky80x15a.gif',
567                                          'content_big' => 'img/virtualsky_big.png'),
568                                  array ( 'id' => 'btn_dynamica',
569                                          'url' => 'http://www.dynamica.it',
570                                          'content' => 'img/dynamica.png',
571                                          'content_big' => 'img/dynamica_big.png')
572                                  );
573
574     $altout_support_arr = array( array ( 'id' => 'btn_brichi',
575                                          'url' => 'http://www.briscolachiamata.it',
576                                          'content' => 'img/brichi.png',
577                                          'content_big' => 'img/brichi_big.png'),
578                                  array ( 'id' => 'btn_foroli',
579                                          'url' => 'http://www.forumolimpia.it',
580                                          'content' => 'img/forumolimpia.gif',
581                                          'content_big' => 'img/forumolimpia_big.png' ),
582                                  array ( 'id'=> 'btn_niini',
583                                          'url' => 'http://www.niinivirta.it',
584                                          'content' => 'img/niinivirta.png',
585                                          'content_big' => 'img/niinivirta_big.png') );
586
587
588
589     $altout_support = "";
590     $altout_support_big = "";
591     for ($i = 0 ; $i < 4 ; $i++) {
592         $ii = ($i < 3 ? $i : 0);
593
594         $altout_support .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>'."\n",
595                                    $i * 20, $altout_support_arr[$ii]['url'],
596                                    $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
597
598         $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
599                                        $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
600     }
601
602
603     // seed with microseconds since last "whole" second
604     // srand ((double) microtime() * 1000000);
605     // $randval = rand(0,count($altout_sponsor_arr)-1);
606     $altout_sponsor = "";
607     $altout_sponsor_big = "";
608     for ($i = 0 ; $i < 4 ; $i++) {
609         $ii = ($i < 3 ? $i : 0);
610
611         $altout_sponsor .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>'."\n",
612                                    $i * 20, $altout_sponsor_arr[$ii]['url'],
613                                    $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
614
615         $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
616                                        $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']);
617     }
618
619
620
621     /* NOTE: Brisk donate or donate fake if local */
622     if (!$G_is_local)
623         $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
624     else
625         $brisk_donate = '<div style="background-color: #ff0; height: 27px; margin-top: 4px;">BRISK_DONATE</div>';
626
627     if ($brisk_donate == FALSE)
628         $brisk_donate = "";
629
630
631     /* MLANG: "briscola chiamata in salsa ajax", */
632
633     mt_srand(make_seed());
634     if (!$G_is_local && $_cookie_law_3party == 'true') {
635         $rn = rand(0, 1);
636
637         if ($rn == 0) {
638             $banner_top_left = '<script type="text/javascript"><!--
639 google_ad_client = "pub-5246925322544303";
640 google_ad_width = 234;
641 google_ad_height = 60;
642 google_ad_format = "234x60_as";
643 google_ad_type = "text_image";
644 google_ad_channel = "";
645 google_color_border = "808080";
646 google_color_bg = "f6f6f6";
647 google_color_link = "ffae00";
648 google_color_text = "404040";
649 google_color_url = "000000";
650 //-->
651 </script>
652 <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
653             $banner_top_right = carousel_top();
654         }
655         else {
656             $banner_top_left = carousel_top();
657             $banner_top_right = '<script type="text/javascript"><!--
658 google_ad_client = "pub-5246925322544303";
659 google_ad_width = 234;
660 google_ad_height = 60;
661 google_ad_format = "234x60_as";
662 google_ad_type = "text_image";
663 google_ad_channel = "";
664 google_color_border = "808080";
665 google_color_bg = "f6f6f6";
666 google_color_link = "ffae00";
667 google_color_text = "404040";
668 google_color_url = "000000";
669 //-->
670 </script>
671 <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
672         }
673     }
674     else { // !$G_is_local
675         $banner_top_left  = carousel_top();
676         $banner_top_right = carousel_top();
677     }
678
679     $brisk_header_form = '<div class="container">
680 <!-- =========== header ===========  -->
681 <div id="header" class="header">
682 <table width="100%%" border="0" cols="3"><tr>
683 <td align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
684 <td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
685  <img class="nobo" src="img/brisk_logo64.png">'
686 /*    <img class="nobo" src="img/brisk_logo64_blackribbon.png" title="ciao Prof" alt="ciao Prof">' */
687     .$mlang_room['headline'][$G_lang].'<br>
688     </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>',
689                                                                 ($G_with_topbanner ? $G_topbanner :
690 "<div style='background-color: #ffd780; border: 1px solid black; text-align: center;'><img class='nobo' src=\"donometer.php?c=".$G_donors_cur."&a=".$G_donors_all."\"><div style='padding: 1px; background-color: white;'><b>donatori</b></div></div>") ) : '').'</td>
691 <td align="right"><div style="padding-right: 8px;">
692 '.$banner_top_right.'</div></td>
693 </tr></table>
694 </div>';
695
696     /* MLANG: ALL THE VERTICAL MENU */
697     $brisk_vertical_menu = '
698 <!--  =========== vertical menu ===========  -->
699 <div class="topmenu">
700 <!-- <a target="_blank" href="/briskhome.php"></a> -->
701
702 <div class="webstart_hilite">
703 <img class="nobo" style="cursor: pointer;" src="img/brisk_start.png" onmouseover="menu_hide(0,0); menu_show(\'menu_webstart\');">
704 <div class="webstart" id="menu_webstart" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
705
706 <a href="#" onmouseover="menu_hide(0,1);" title="'.$mlang_room['tit_help'][$G_lang].'" onclick="act_help();"
707    >'.$mlang_room['itm_help'][$G_lang].'</a><br>
708
709 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php"
710    onmouseover="menu_hide(0,1);"
711    title="'.$mlang_room['tit_hpage'][$G_lang].'">homepage</a><br>
712
713 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#cose"
714    onmouseover="menu_hide(0,1);"
715    title="'.$mlang_room['tit_what'][$G_lang].'">'.$mlang_room['itm_what'][$G_lang].'</a><br>
716
717 <a target="_blank" href="'.$mlang_room['url_rules'][$G_lang].'"
718    onmouseover="menu_hide(0,1);"
719    title="'.$mlang_room['tit_rules'][$G_lang].'">'.$mlang_room['itm_rules'][$G_lang].'</a><br>
720
721 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#shots"
722    onmouseover="menu_hide(0,1);"
723    title="'.$mlang_room['tit_shot'][$G_lang].'">screenshoots</a><br>
724
725 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#comp"
726    onmouseover="menu_hide(0,1);"
727    title="'.$mlang_room['tit_comp'][$G_lang].'">'.$mlang_room['itm_comp'][$G_lang].'</a><br>
728
729 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#sources"
730    onmouseover="menu_hide(0,1);"
731    title="'.$mlang_room['tit_src'][$G_lang].'">'.$mlang_room['itm_src'][$G_lang].'</a><br>
732
733 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#mailing"
734    onmouseover="menu_hide(0,1);"
735    title="'.$mlang_room['tit_ml'][$G_lang].'">'.$mlang_room['itm_ml'][$G_lang].'</a><br>
736
737 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#prop"
738    onmouseover="menu_hide(0,1);"
739    title="'.$mlang_room['tit_pro'][$G_lang].'">'.$mlang_room['itm_pro'][$G_lang].'</a><br>
740 <a href="#"
741    onmouseover="menu_hide(0,1);"
742    title="credits" onclick="act_about();">about</a><br>
743
744 <a href="mailto:brisk@alternativeoutput.it"
745    onmouseover="menu_hide(0,1);"
746    title="'.$mlang_room['tit_mail'][$G_lang].'">'.$mlang_room['itm_mail'][$G_lang].'</a><br>
747
748 <a target="_blank" href="http://www.alternativeoutput.it/cookie.php"
749    onmouseover="menu_hide(0,1);"
750    title="'.$mlang_room['tit_cook'][$G_lang].'"
751    alt="'.$mlang_room['tit_cook'][$G_lang].'">'.$mlang_room['itm_cook'][$G_lang].'</a><br>
752 <hr>
753
754 <a href="#"
755    onmouseover="menu_hide(0,1);"
756    title="'.$mlang_room['tit_cla'][$G_lang].'" onclick="act_placing();">'.$mlang_room['itm_cla'][$G_lang].'</a><br>
757
758 <a target="_blank" href="briskin5/explain.php"
759    onmouseover="menu_hide(0,1);"
760    title="'.$mlang_room['tit_mnu'][$G_lang].'">'.$mlang_room['itm_mnu'][$G_lang].'</a><br>
761
762 <a href="#"
763    onmouseover="menu_hide(0,1);"
764    title="'.$mlang_room['tit_rmap'][$G_lang].'" onclick="act_roadmap();">'.$mlang_room['itm_rmap'][$G_lang].'</a><br>
765
766 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'"
767    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
768
769 <div style="text-align: right;" id="menu_meeting" class="webstart">
770 <a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
771    target="_blank" onmouseover="menu_hide(0,2);"
772    title="1° Torneo-Meeting di Lodi del 21/02/2010" ><img style="display: inline;" class="nobo" src="img/coppa16.png">Lodi 02/10</a><br>
773
774 <a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
775    target="_blank" onmouseover="menu_hide(0,2);"
776    title="1° Torneo-Meeting di Parma del 22/11/2009"><img style="display: inline;" class="nobo" src="img/coppa16.png">Parma 11/09</a><br>
777
778 <a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
779    target="_blank" onmouseover="menu_hide(0,2);"
780    title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
781
782 <a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
783    target="_blank" onmouseover="menu_hide(0,2);"
784    title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
785
786 <a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
787    target="_blank" onmouseover="menu_hide(0,2);"
788    title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
789
790 <a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1"
791    target="_blank" onmouseover="menu_hide(0,2);"
792    title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
793
794 <a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1"
795    target="_blank" onmouseover="menu_hide(0,2);"
796    title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
797
798 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806"
799    target="_blank" onmouseover="menu_hide(0,2);"
800    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
801
802 <a href="http://www.anomalia.it/mop/photoo"
803    target="_blank" onmouseover="menu_hide(0,2);"
804    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
805
806 </div>
807 </div>'. ($ACTION == "room" ? '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div><img class="nobo" style="cursor: pointer;" src="img/brisk_commands'.langtolng($G_lang).'.png" onmouseover="menu_hide(0,0); menu_show(\'menu_commands\');">
808
809 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
810
811 <a href="#" title="'
812           // MLANG
813           .$mlang_room['tit_stat'][$G_lang].
814 '"
815    onmouseover="menu_hide(0,1); menu_show(\'menu_state\');">'
816           // MLANG
817           .$mlang_room['stat_desc'][$G_lang].
818 '</a><br>
819 <div id="menu_state" class="webstart">
820 <a href="#"
821    onmouseover="menu_hide(0,2);"
822    title="" onclick="act_chatt(\'/st normale\'); menu_over(-1,this);">'
823           // MLANG
824           .$mlang_room['st_norm_desc'][$G_lang].
825 '</a><br>
826
827 <a href="#"
828    onmouseover="menu_hide(0,2);"
829    title="" onclick="act_chatt(\'/st pausa\'); menu_over(-1,this);">'
830           // MLANG
831           .$mlang_room['st_paus_desc'][$G_lang].
832 '&nbsp;<img class="unbo" src="img/st_pau.png"></a><br>
833
834 <a href="#"
835    onmouseover="menu_hide(0,2);"
836    title="" onclick="act_chatt(\'/st fuori\'); menu_over(-1,this);">'
837           // MLANG
838           .$mlang_room['st_out_desc'][$G_lang].
839 '&nbsp;<img class="unbo" src="img/st_out.png"></a><br>
840
841 <a href="#"
842    onmouseover="menu_hide(0,2);"
843    title="" onclick="act_chatt(\'/st cane\'); menu_over(-1,this);">'
844           // MLANG
845           .$mlang_room['st_dog_desc'][$G_lang].
846 '&nbsp;<img class="unbo" src="img/st_dog.png"></a><br>
847
848 <a href="#"
849    onmouseover="menu_hide(0,2);"
850    title="" onclick="act_chatt(\'/st cibo\'); menu_over(-1,this);">'
851           // MLANG
852           .$mlang_room['st_food_desc'][$G_lang].
853 '&nbsp;<img class="unbo" src="img/st_eat.png"></a><br>
854
855 <a href="#"
856    onmouseover="menu_hide(0,2);"
857    title="" onclick="act_chatt(\'/st lavoro\'); menu_over(-1,this);">'
858           // MLANG
859           .$mlang_room['st_work_desc'][$G_lang].
860 '&nbsp;<img class="unbo" src="img/st_wrk.png"></a><br>
861
862 <a href="#"
863    onmouseover="menu_hide(0,2);"
864    title="" onclick="act_chatt(\'/st sigaretta\'); menu_over(-1,this);">'
865           // MLANG
866           .$mlang_room['st_smok_desc'][$G_lang].
867 '&nbsp;<img class="unbo" src="img/st_smk.png"></a><br>
868
869 <a href="#"
870    onmouseover="menu_hide(0,2);"
871    title="" onclick="act_chatt(\'/st presente\'); menu_over(-1,this);">'
872           // MLANG
873           .$mlang_room['st_pres_desc'][$G_lang].
874 '&nbsp;<img class="unbo" src="img/st_eye.png"></a><br>
875
876 <a href="#"
877    onmouseover="menu_hide(0,2);"
878    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
879           // MLANG
880           .$mlang_room['st_rabb_desc'][$G_lang].
881 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
882
883 <a href="#"
884    onmouseover="menu_hide(0,2);"
885    title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
886           // MLANG
887           .$mlang_room['st_socc_desc'][$G_lang].
888 '&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
889
890 <a href="#"
891    onmouseover="menu_hide(0,2);"
892    title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
893           // MLANG
894           .$mlang_room['st_baby_desc'][$G_lang].
895 '&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
896
897 <a href="#"
898    onmouseover="menu_hide(0,2);"
899    title="" onclick="act_chatt(\'/st pulizie\'); menu_over(-1,this);">'
900           // MLANG
901           .$mlang_room['st_mop_desc'][$G_lang].
902 '&nbsp;<img class="unbo" src="img/st_mop.png"></a><br>
903
904 <a href="#"
905    onmouseover="menu_hide(0,2);"
906    title="" onclick="act_chatt(\'/st babbo\'); menu_over(-1,this);">'
907           // MLANG
908           .$mlang_room['st_babbo_desc'][$G_lang].
909 '&nbsp;<img class="unbo" src="img/st_babbo.png"></a><br>
910
911 <a href="#"
912    onmouseover="menu_hide(0,2);"
913    title="" onclick="act_chatt(\'/st renna\'); menu_over(-1,this);">'
914           // MLANG
915           .$mlang_room['st_renna_desc'][$G_lang].
916 '&nbsp;<img class="unbo" src="img/st_renna.png"></a><br>
917
918 <a href="#"
919    onmouseover="menu_hide(0,2);"
920    title="" onclick="act_chatt(\'/st pupazzo\'); menu_over(-1,this);">'
921           // MLANG
922           .$mlang_room['st_pupaz_desc'][$G_lang].
923 '&nbsp;<img class="unbo" src="img/st_pupaz.png"></a><br>
924
925 <a href="#"
926    onmouseover="menu_hide(0,2);"
927    title="" onclick="act_chatt(\'/st vischio\'); menu_over(-1,this);">'
928           // MLANG
929           .$mlang_room['st_visch_desc'][$G_lang].
930 '&nbsp;<img class="unbo" src="img/st_visch.png"></a><br>
931
932 </div>
933
934 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo"
935    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/tav \'+$(\'txt_in\').value); menu_over(-1,this);">ticker &nbsp;<img class="unbo" src="img/train.png"></a><br>
936
937 <a href="#" title="'
938           // MLANG garantisci per un tuo conoscente
939           .$mlang_room['warr_desc'][$G_lang].
940 '"
941    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/authreq\'); menu_over(-1,this);">'
942           // MLANG garantisci
943           .$mlang_room['itm_warr'][$G_lang].
944           '</a><br>
945
946
947
948 <a href="#" title="'
949           // MLANG garantisci per un tuo conoscente
950           .$mlang_room['splash_desc'][$G_lang].
951 '"
952    onmouseover="menu_hide(0,1);" onclick="act_splash(); menu_over(-1,this);">'
953           // MLANG garantisci
954           .$mlang_room['tit_splash'][$G_lang].
955           '</a><br>
956 '.($user->is_auth() ? '
957 <a href="#" title="'
958           // MLANG garantisci per un tuo conoscente
959           .$mlang_room['prefs_desc'][$G_lang].'"
960    onmouseover="menu_hide(0,1);" onclick="$(\'preferences\').style.visibility = \'visible\'; menu_over(-1,this);">'
961           // MLANG garantisci
962    .$mlang_room['tit_prefs'][$G_lang].'</a><br>' : '').'
963
964 </div>'.($G_with_poll ? '' : '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
965 <img style="cursor: pointer;" class="nobo" src="img/brisk_help'.langtolng($G_lang).'.png" title="'.$mlang_room['tit_help'][$G_lang].'" onmouseover="menu_hide(0,0);" onclick="act_help();">').'
966 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
967 '.($user->flags & USER_FLAG_AUTH ? '
968 <img style="cursor: pointer;" class="nobo" src="img/brisk_signal'.langtolng($G_lang).'.png" title="'.$mlang_room['tit_mesg'][$G_lang].'" onmouseover="menu_hide(0,0);" onclick="act_chatt(\'/mesgtoadm\');">'.poll_dom()
969  : '
970 <img style="cursor: pointer;" class="nobo" src="img/brisk_password.png" title="Come ottenere una password su Brisk." onmouseover="menu_hide(0,0);" onclick="act_passwdhowto();">
971 ').'
972
973 ' : '').'
974
975 </div>
976 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
977 sponsored by:<br>
978 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
979 <div id="spon_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */ ">
980 <div style="/*background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_sponsor.'<br>
981 </div></div>
982 <div style="position: absolute;">
983 '.$altout_sponsor_big.'
984 </div>
985 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
986 supported by:<br>
987 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
988 <div id="supp_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */">
989 <div style="/* background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_support.'<br>
990
991 </div>
992 </div>
993 <div style="position: absolute;">
994 '.$altout_support_big.'
995 </div>
996 <a style="/* position: absolute; top: 40px; left: 6px; */" target="_blank" href="https://www.facebook.com/groups/59742820791"><img class="nobo" id="btn_facebook" src="img/facebook_btn.png" title="unisciti al gruppo \'quelli della brisk\'"></a>
997 ' . ( /* NOTE: here facebook or fake facebook */
998 (!$G_is_local && $_cookie_law_3party == 'true') ?
999 '<div class="fb-like" style="margin-top: 4px;" data-href="https://www.facebook.com/pages/Brisk-briscola-chiamata-in-salsa-ajax/716026558416911" data-share="false" data-send="true" data-width="70" data-show-faces="false" data-colorscheme="dark" layout="button_count"></div>
1000 ' : '' ) . '<div id="proflashext" class="proflashext"><div id="proflash" class="proflash"></div></div>
1001 <img id="stm_stat" class="nobo" style="margin-top: 4px;" src="img/line-status_b.png">
1002 %s
1003 %s
1004 </div>';
1005
1006     /* Templates. */
1007     if ($ACTION == 'login') {
1008         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1009 ?>
1010 <html>
1011 <head>
1012 <title>Brisk</title>
1013 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1014 <link rel="shortcut icon" href="img/brisk_ico.png">
1015 <script type="text/javascript" src="commons.js"></script>
1016 <script type="text/javascript" src="fieldify.js"></script>
1017 <script type="text/javascript" src="prefs.js"></script>
1018 <script type="text/javascript" src="info.js"></script>
1019 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1020 <script type="text/javascript" src="menu.js"></script>
1021 <script type="text/javascript" src="heartbit.js"></script>
1022 <script type="text/javascript" src="xynt-streaming.js"></script>
1023 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1024 <script type="text/javascript" src="AC_OETags.js"></script>
1025 <script type="text/javascript" src="room.js"></script>
1026 <script type="text/javascript" src="md5.js"></script>
1027 <script type="text/javascript" src="probrowser.js"></script>
1028 <script type="text/javascript" src="json2.js"></script>
1029 <script type="text/javascript" src="/cookie_law.js"></script>
1030 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1031 <link rel="stylesheet" type="text/css" href="brisk.css">
1032 <link rel="stylesheet" type="text/css" href="room.css">
1033
1034 <script type="text/javascript"><!--
1035 var g_debug = 0;
1036 var g_lang = "<? echo $G_lang; ?>";
1037 var g_lng = "<? echo $G_lng; ?>";
1038 var g_tables_n = <? echo TABLES_N; ?>;
1039 var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1040 var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1041 var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1042 var g_prefs, g_prefs_new = null;
1043 var g_listen;
1044 var g_withflash = false;
1045 var g_is_spawn = 0;
1046 var g_nd = null;
1047 var g_brow = null;
1048 var gst  = new globst();
1049 var topbanner_sfx, topbanner_dx;
1050 var xstm = null;
1051 var sess = "not_connected";
1052 var spo_slide, sup_slide;
1053
1054 window.onload = function() {
1055     // alert(window.onbeforeunload);
1056     g_brow = get_browser_agent();
1057
1058     g_prefs = new client_prefs(null);
1059
1060     spo_slide  = new sideslide($('spon_caro'), 80, 20);
1061     sup_slide  = new sideslide($('supp_caro'), 80, 20);
1062
1063     login_init();
1064     <?php
1065         if ($G_with_topbanner) {
1066             printf("    topbanner_init();\n");
1067         }
1068     sidebanners_init($G_sidebanner_idx);
1069     ?>
1070
1071     g_withflash = DetectFlashVer(6,0,0);
1072     if (g_withflash == false) {
1073         $("proflash").innerHTML = 'Audio con Flash.<br><a href="http://www.macromedia.com/"><img class="nobo" style="padding: 4px; width:73; height: 19;" src="img/download_now_flash.gif"></a>';
1074     }
1075     else
1076         $("proflashext").innerHTML = "";
1077     $("nameid").focus();
1078 }
1079 //-->
1080 </script>
1081 </head>
1082 <?php
1083         if (!$G_is_local && $_cookie_law_3party == 'true') {
1084 ?>
1085 <!-- if myconsole <body onunload="deconsole();"> -->
1086 <body xmlns:fb="http://ogp.me/ns/fb#">
1087 <div id="fb-root"></div>
1088 <script type="text/javascript"><!--
1089 (function(d, s, id) {
1090     var js, fjs = d.getElementsByTagName(s)[0];
1091     if (d.getElementById(id)) return;
1092     js = d.createElement(s); js.id = id;
1093     js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1094     fjs.parentNode.insertBefore(js, fjs);
1095 }(document, 'script', 'facebook-jssdk'));</script>
1096 <?php
1097         }
1098         else {
1099 ?>
1100 <body>
1101 <?php
1102         }
1103         printf($brisk_header_form);
1104         printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1105         printf($brisk_vertical_menu, '', '');
1106
1107         sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1108         printf("</td><td>");
1109 ?>
1110
1111 <!--  =========== tables ===========  -->
1112 <?php
1113
1114 /* MLANG: "Digita il tuo nickname per accedere ai tavoli della briscola.", "entra", "Se non hai ancora una password, lascia il campo in bianco ed entra." ,"(se usi firefox e qualcosa non funziona prova a ricaricare la pagina con Ctrl + F5)" */
1115         echo "$body";
1116 ?>
1117     <br>
1118     <div style="text-align: center;">
1119     <br>
1120         <div class="bye_msg" id="bye_msg"><?php echo "$last_msg"; ?></div>
1121     <br>
1122 <?php echo $mlang_room['welcome'][$G_lang];?>
1123     <br><br>
1124     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_login_manager(this);">
1125     <input id="passid_private" name="pass_private" type="hidden" value="">
1126     <table class="login">
1127     <tr><td>nickname:</td>
1128     <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1129     <tr><td>password:</td>
1130     <td><input id="passid" class="input_text" name="pass" type="password" size="24" maxlength="64" value=""></td></tr>
1131     <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_enter'][$G_lang];?>" type="submit" class="button"></td></tr>
1132     </table>
1133     </form><br>
1134
1135     <?php echo $mlang_room['passwarn'][$G_lang];?><br><br>
1136
1137          <button onclick="$('apprentice_div').style.display = ($('apprentice_div').style.display == 'none' ? 'inline-block' : 'none');">Vuoi ottenere un accesso da apprendista ?</button><br><br>
1138              <div id="apprentice_div" style="display: none;" class="apprentice">
1139          <br>
1140          Inserisci il tuo nickname e il tuo indirizzo e-mail.<br>
1141          Il tuo nickname non può essere più lungo di 12 caratteri,<br>deve essere composto soltanto da lettere non accentate e numeri,<br>senza ripetere lo stesso carattere per più di 3 volte consecutive.<br><br>
1142     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_new_apprentice(this);">
1143     <input type="hidden" name="realsub" value="666">
1144     <table class="login">
1145     <tr><td>nickname:</td>
1146     <td><input id="nameid" class="input_text" name="cli_name" type="text" size="24" maxlength="12" value=""></td></tr>
1147     <tr><td>e-mail:</td>
1148     <td><input id="emailid" class="input_text" name="cli_email" type="text" size="24" maxlength="512" value=""></td></tr>
1149                                                                           <tr><td colspan="2"><table style="margin: auto;"><tr><td><input id="send" onclick="submit_click(this);" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" class="button"></td>
1150         <td><input id="close" onclick="submit_click(this);" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button"></td></tr></table></td></tr>
1151     </table>
1152     </form></div>
1153          <br><br>
1154 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
1155     </div>
1156
1157     <div id="imgct"></div>
1158     <div id="logz"></div>
1159     <div id="sandbox"></div>
1160     <div id="sandbox2"></div>
1161     <div id="response"></div>
1162     <div id="xhrstart"></div>
1163     <pre>
1164     <div id="xhrlog"></div>
1165     </pre>
1166     <div id="xhrdeltalog"></div>
1167
1168 <script language="JavaScript">
1169 <!--
1170 cookie_law(null);
1171 // -->
1172 </script>
1173 </body>
1174 </html>
1175 <?php
1176     }
1177     else if ($ACTION == 'room') {
1178         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1179 ?>
1180 <html>
1181 <head>
1182 <title>Brisk</title>
1183 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1184 <link rel="shortcut icon" href="img/brisk_ico.png">
1185 <script type="text/javascript" src="commons.js"></script>
1186 <script type="text/javascript" src="fieldify.js"></script>
1187 <script type="text/javascript" src="prefs.js"></script>
1188 <script type="text/javascript" src="info.js"></script>
1189 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1190 <script type="text/javascript" src="menu.js"></script>
1191 <script type="text/javascript" src="ticker.js"></script>
1192 <script type="text/javascript" src="heartbit.js"></script>
1193 <script type="text/javascript" src="xynt-streaming.js"></script>
1194 <script type="text/javascript" src="room.js"></script>
1195 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1196 <script type="text/javascript" src="AC_OETags.js"></script>
1197 <script type="text/javascript" src="probrowser.js"></script>
1198 <script type="text/javascript" src="json2.js"></script>
1199 <script type="text/javascript" src="/cookie_law.js"></script>
1200 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1201 <link rel="stylesheet" type="text/css" href="brisk.css">
1202 <link rel="stylesheet" type="text/css" href="room.css">
1203 <script type="text/javascript"><!--
1204    var sess = "not_connected";
1205    var g_debug = 0;
1206    var g_lang = "<? echo $G_lang; ?>";
1207    var g_lng = "<? echo $G_lng; ?>";
1208    var g_tables_n = <? echo TABLES_N; ?>;
1209    var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1210    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1211    var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1212    var g_prefs, g_prefs_new = null;
1213    var g_listen;
1214    var g_is_spawn = 0;
1215    var g_withflash = false;
1216    var g_imgct = 0;
1217    var g_imgtot = g_preload_img_arr.length;
1218    var g_brow = null;
1219    var g_nd = null;
1220    var tra = null;
1221    var stat = "";
1222    var subst = "";
1223    var gst  = new globst();
1224    var topbanner_sfx, topbanner_dx;
1225    // var nonunload = false;
1226    var spo_slide, sup_slide;
1227
1228    window.onload = function() {
1229      g_brow = get_browser_agent();
1230
1231      g_prefs = new client_prefs(null);
1232
1233      spo_slide  = new sideslide($('spon_caro'), 80, 20);
1234      sup_slide  = new sideslide($('supp_caro'), 80, 20);
1235
1236 <?php
1237         if ($BRISK_SHOWHTML == "debugtable") {
1238 ?>
1239      room_checkspace(12, <?php echo TABLES_N; ?>, 50);
1240 <?php
1241         }
1242         else {
1243 ?>
1244     // alert("INDEX START");
1245      menu_init();
1246 <?php
1247         if ($G_with_topbanner) {
1248             printf("     topbanner_init();\n");
1249         }
1250         sidebanners_init($G_sidebanner_idx);
1251 ?>
1252      sess = "<?php echo "$sess"; ?>";
1253 xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", 80, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
1254      xstm.hbit_set(heartbit);
1255      tra = new train($('room_tit'));
1256      window.onunload = onunload_cb;
1257      window.onbeforeunload = onbeforeunload_cb;
1258      g_withflash = DetectFlashVer(6,0,0);
1259      if (g_withflash == false) {
1260        $("proflash").innerHTML = 'Audio con Flash.<br><a href="http://www.macromedia.com/"><img class="nobo" style="padding: 4px; width:73; height: 19;" src="img/download_now_flash.gif"></a>';
1261      }
1262      else
1263        $("proflashext").innerHTML = "";
1264
1265      // console.log("session from main: "+sess);
1266      xstm.start();
1267      // alert("ARR LENGTH "+g_preload_img_arr.length);
1268      // FIXME: preload image will be fired by stream instead here
1269      // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
1270      $("txt_in").focus();
1271 <?php
1272         if ($is_login) {
1273   /* MLANG: "<br>Il nickname che stai usando &egrave; gi&agrave; registrato,<br><br>se il suo proprietario si autentificher&agrave;<br><br>verrai rinominato d'ufficio come ghost<i>N</i>.", "torna ai tavoli" */
1274             echo show_notify($mlang_room['regwarn'][$G_lang], 0, $mlang_room['btn_rettabs'][$G_lang], 400, 150);
1275         }
1276     }
1277 ?>
1278 }
1279 //-->
1280 </script>
1281 </head>
1282 <?php
1283     if (!$G_is_local && $_cookie_law_3party == 'true') {
1284 ?>
1285 <!-- if myconsole <body onunload="deconsole();"> -->
1286 <body xmlns:fb="http://ogp.me/ns/fb#">
1287 <div id="fb-root"></div>
1288 <script>(function(d, s, id) {
1289   var js, fjs = d.getElementsByTagName(s)[0];
1290   if (d.getElementById(id)) return;
1291   js = d.createElement(s); js.id = id;
1292   js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1293   fjs.parentNode.insertBefore(js, fjs);
1294 }(document, 'script', 'facebook-jssdk'));</script>
1295 <?php
1296     }
1297     else {
1298 ?>
1299 <body>
1300 <?php
1301     }
1302     printf($brisk_header_form);
1303     printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1304     printf($brisk_vertical_menu, '', $brisk_donate);
1305
1306     sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1307
1308     printf("</td><td>");
1309 ?>
1310 <!--  =========== tables ===========  -->
1311 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
1312 <table class="macro"><tr><td>
1313 <?php echo "$tables";?>
1314 </td></tr><tr><td>
1315 <?php echo "$standup";?>
1316 </td></tr></table>
1317 </td></tr></table>
1318
1319 <!--  =========== bottom ===========  -->
1320 <div id="bottom" class="bottom">
1321 <b>Chat</b> <span id="list_info" style="color: red;"></span><br>
1322 <div id="txt" class="chatt">
1323 </div>
1324 <div style="text-align: center; ">
1325     <!-- MLANG: scrivi un invito al tavolo e clicca -->
1326     <table style="width: 98%; margin: auto;"><tr><td id="tickbut" class="tickbut"><img class="tickbut" src="img/train.png" onclick="act_tav();" title="<?php echo $mlang_room['tit_ticker'][$G_lang];?>"></td><td style="width:1%; text-align: center;">
1327     <div id="myname"></div>
1328     </td><td>
1329     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
1330     </td></tr></table>
1331 </div>
1332 </div>
1333
1334     <div id="authbox" class="notify" style="text-align: center;">
1335        <br>
1336        <b>
1337     <!-- MLANG: Garantisci per un tuo conoscente: -->
1338 <?php echo $mlang_room['tit_warr'][$G_lang];?>
1339 </b>
1340        <br><br>
1341
1342        <form id="auth_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_authbox(this);">
1343        <input type="hidden" name="realsub" value="666">
1344 <table class="login">
1345 <tr><td>nickname:</td>
1346 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1347 <tr><td>e-mail:</td>
1348 <td><input id="emailid" class="input_text" name="email" type="text" size="24" maxlength="1024" value=""></td></tr>
1349 <tr><td colspan="2" style="text-align: center;">
1350     <!-- MLANG: Garantisci per un tuo conoscente: -->
1351        <input id="subid" name="sub" value=
1352 "<?php echo $mlang_room['btn_send'][$G_lang]; ?>"
1353  type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1354     <!-- MLANG: Garantisci per un tuo conoscente: -->
1355 <input id="cloid" name="clo" value=
1356 "<?php echo $mlang_room['btn_close'][$G_lang]; ?>"
1357 type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1358 </table>
1359     </form>
1360     </div>
1361     <div id="mesgtoadmbox" class="notify_opaque" style="text-align: center;">
1362        <br>
1363 <!--MLANG: Invia un messaggio o una segnalazione all\'amministratore: -->
1364        <b><?php echo $mlang_room['mesgtoadm_tit'][$G_lang];?></b>
1365        <br><br>
1366        <form id="mesgtoadm_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_mesgtoadmbox(this);">
1367        <input type="hidden" name="realsub" value="666">
1368 <table class="login">
1369 <!--MLANG: soggetto -->
1370 <tr><td><b><?php echo $mlang_room['mesgtoadm_sub'][$G_lang];?></b></td>
1371 <td><input id="subjid" class="input_text" name="subj" type="text" size="32" maxlength="255" value=""></td></tr></table>
1372 <table class="login">
1373 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
1374 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
1375 <tr><td colspan="2" style="text-align: center;">
1376        <input id="subid" name="sub" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" onclick="submit_click(this);" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1377 <input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="submit_click(this);"></td></tr>
1378 </table>
1379     </form>
1380     </div>
1381 <div id="heartbit"></div>
1382 <div id="sandbox"></div>
1383 <div id="imgct"></div>
1384 <div id="logz"></div>
1385 <div id="sandbox2"></div>
1386 <div id="response"></div>
1387 <div id="remark"></div>
1388 <div id="xhrstart"></div>
1389 <div id="xhrlog"></div>
1390 <div id="xhrdeltalog"></div>
1391 </div>
1392
1393 <div id="info" class="notify" style="z-index: 200; width: 500px; margin-left: -250px; height: 340px; top: 150px; visibility: hidden;">
1394 <table class="info">
1395
1396 <tr>
1397 <td class="head"><span><?php echo $mlang_room['info_login'][$G_lang]; ?>:</span></td>
1398 <td class="ri b-right data"><span class="login_id"></span></td>
1399 <td class="head"><span><?php echo $mlang_room['info_status'][$G_lang]; ?>:</span></td>
1400 <td class="ri data"><span class="state_id"></span></td>
1401 </tr>
1402
1403 <tr>
1404 <td class="head"><span><?php echo $mlang_room['info_guar'][$G_lang]; ?>:</span></td>
1405 <td class="ri b-right data"><span class="guar_id"></span></td>
1406 <td class="head"><span class="title" title="<?php echo $mlang_room['info_match_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_match'][$G_lang]; ?>:</span></td>
1407 <td class="ri data"><span class="match_id"></span></td>
1408 </tr>
1409
1410 <tr>
1411 <td class="head"><span class="title" title="<?php echo $mlang_room['info_party_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_party'][$G_lang]; ?>:</span></td>
1412 <td class="ri b-right data"><span class="party_id"></span></td>
1413 <td class="head"><span class="title" title="<?php echo $mlang_room['info_game_tit'][$G_lang]; ?>"><?php echo $mlang_room['info_game'][$G_lang]; ?>:</span></td>
1414 <td class="ri data"><span class="game_id"></span></td>
1415 </tr>
1416
1417 <tr class="widefriend_id">
1418 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repfrie'][$G_lang]; ?>:</span></td>
1419 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td>
1420 </tr>
1421
1422 <tr class="widefriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1423 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1424 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1425 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1426
1427 <tr class="narrowfriend_id">
1428 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repbff'][$G_lang]; ?>:</span></td>
1429 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td></tr>
1430
1431 <tr class="narrowfriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1432 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1433 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1434 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1435 <tr><td class="le ri triple" colspan="3"><b><?php echo $mlang_room['info_frie'][$G_lang]; ?></b></td>
1436 <td class="le data triple"><input type="radio" name="friend" class="friend_id" value="black"
1437     onclick="info_onlyifknown_isvisible();">Da evitare</td></tr>
1438 <tr>
1439 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="unknown"
1440     onclick="info_onlyifknown_isvisible();">Sconosciuto</td>
1441 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="test"
1442     onclick="info_onlyifknown_isvisible();">In prova</td>
1443 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="friend"
1444     onclick="info_onlyifknown_isvisible();">Amico</td>
1445 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="bff"
1446     onclick="info_onlyifknown_isvisible();">Amico fidato</td>
1447 </tr>
1448 <tr class="onlyifknown_gid">
1449 <td class="le head"><span><?php echo $mlang_room['info_skill'][$G_lang]; ?>:</span></td>
1450 <td class="data">
1451     <table class="fiverank" style="margin: auto;">
1452        <tr><td class="c1t">1</td>
1453            <td class="c2t">2</td>
1454            <td class="c3t">3</td>
1455            <td class="c4t">4</td>
1456            <td class="c5t">5</td></tr>
1457        <tr><td class="c1b"><input type="radio" name="skill" class="skill_id" value="1"></td>
1458            <td class="c2b"><input type="radio" name="skill" class="skill_id" value="2"></td>
1459            <td class="c3b"><input type="radio" name="skill" class="skill_id" value="3"></td>
1460            <td class="c4b"><input type="radio" name="skill" class="skill_id" value="4"></td>
1461            <td class="c5b"><input type="radio" name="skill" class="skill_id" value="5"></td>
1462        </tr>
1463     </table>
1464 </td>
1465 <td class="le"><b>Credibilità:</b></td>
1466 <td class="data">
1467     <table class="fiverank" style="margin: auto;">
1468        <tr><td class="c1t">1</td>
1469            <td class="c2t">2</td>
1470            <td class="c3t">3</td>
1471            <td class="c4t">4</td>
1472            <td class="c5t">5</td></tr>
1473        <tr><td class="c1b"><input type="radio" name="trust" class="trust_id" value="1"></td>
1474            <td class="c2b"><input type="radio" name="trust" class="trust_id" value="2"></td>
1475            <td class="c3b"><input type="radio" name="trust" class="trust_id" value="3"></td>
1476            <td class="c4b"><input type="radio" name="trust" class="trust_id" value="4"></td>
1477            <td class="c5b"><input type="radio" name="trust" class="trust_id" value="5"></td>
1478        </tr>
1479     </table>
1480 </td></tr>
1481 </table>
1482 <div style="position: absolute; bottom: 8px; margin: auto; width: 100%;">
1483 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('info').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1484 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1485 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1486 </div>
1487
1488 </div>
1489
1490 <div id="preferences" class="notify" style="z-index: 200; width: 600px; margin-left: -300px; height: 240px; top: 150px; visibility: hidden;">
1491 <div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 370px;">
1492
1493 <h2><?php echo $mlang_room['tit_prefs'][$G_lang]; ?></h2>
1494 <table style="margin: auto;"><tr><td style="vertical-align: top;">
1495 <!--#
1496     #  LISTEN
1497     #-->
1498 <div style="float: left; padding: 8px;">
1499 <table style="border: 1px solid gray;"><tr><th style="background-color: #cccccc;">
1500 <?php echo $mlang_room['itm_list'][$G_lang];?>
1501 </th></tr>
1502 <tr><td><input style="vertical-align: bottom;" id="ra_listen_all" type="radio" name="listen" value="0" onclick="prefs_update('listen');" title="'
1503 <?php echo $mlang_room['listall_desc'][$G_lang];?>
1504 '"><span id="list_all">
1505 <?php echo $mlang_room['tit_listall'][$G_lang];?>
1506 </span></td></tr>
1507 <tr><td><input style="vertical-align: bottom;" id="ra_listen_auth" type="radio" name="listen" value="1" onclick="prefs_update('listen');" title="'
1508 <?php echo $mlang_room['listaut_desc'][$G_lang];?>
1509 '"><span id="list_auth">
1510 <?php echo $mlang_room['tit_listaut'][$G_lang];?>
1511 </span></td></tr>
1512 <tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="2" onclick="prefs_update('listen');" title="'
1513 <?php echo $mlang_room['listisol_desc'][$G_lang];?>
1514 '"><span id="list_isol">
1515 <?php echo $mlang_room['tit_listisol'][$G_lang];?>
1516 </span></td></tr>
1517 </table>
1518 </div>
1519 <?php
1520     if ($user->is_supp_custom()) {
1521 ?>
1522 </td>
1523 <td style="vertical-align: top;">
1524 <!--#
1525     #  SUPPORTER ONLY
1526     #-->
1527 <div style="float: left; padding: 8px;">
1528 <table style="border: 1px solid gray;"><tr><th colspan="4" style="background-color: #cccccc;">
1529 <?php echo $mlang_room['suppcomp_tit'][$G_lang];?>
1530 </th></tr>
1531 <tr>
1532 <th>
1533 <?php echo $mlang_room['suppcomp_fg'][$G_lang];?>
1534 </th><td><input style="width: 3em;" id="s_fg_r" type="text" maxlength="3" size="3" name="s_fg_r"
1535  onchange="prefs_update('supp');" value="255"
1536  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1537    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1538 <td><input style="width: 3em;" id="s_fg_g" type="text" maxlength="3" size="3" name="s_fg_g"
1539  onchange="prefs_update('supp');" value="255"
1540  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1541    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1542 <td><input style="width: 3em;" id="s_fg_b" type="text" maxlength="3" size="3" name="s_fg_b"
1543  onchange="prefs_update('supp');" value="255"
1544  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1545    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1546 </tr>
1547 <tr>
1548 <th>
1549 <?php echo $mlang_room['suppcomp_bg'][$G_lang];?>
1550 </th>
1551 <td><input style="width: 3em;" id="s_bg_r" type="text" maxlength="3" size="3" name="s_bg_r"
1552  onchange="prefs_update('supp');" value="255"
1553  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1554    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1555 <td><input style="width: 3em;" id="s_bg_g" type="text" maxlength="3" size="3" name="s_bg_g"
1556  onchange="prefs_update('supp');" value="255"
1557  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1558    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1559 <td><input style="width: 3em;" id="s_bg_b" type="text" maxlength="3" size="3" name="s_bg_b"
1560  onchange="prefs_update('supp');" value="255"
1561  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1562    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1563 </tr>
1564 <tr><td colspan="4" style="text-align: center;">
1565 <img id="s_img" class="nobo" src="img/noimg.png">
1566 </td></tr>
1567 </table>
1568 </div>
1569 </td>
1570 <td>
1571 <?php
1572         }
1573         else {
1574 ?>
1575 <input id="s_fg_r" type="hidden" name="s_fg_r">
1576 <input id="s_fg_g" type="hidden" name="s_fg_g">
1577 <input id="s_fg_b" type="hidden" name="s_fg_b">
1578 <input id="s_bg_r" type="hidden" name="s_bg_r">
1579 <input id="s_bg_g" type="hidden" name="s_bg_g">
1580 <input id="s_bg_b" type="hidden" name="s_bg_b">
1581 <input id="s_img"  type="hidden" name="s_bg_b">
1582 <?php
1583         }
1584 ?>
1585 </td></tr></table>
1586 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
1587 <br><br>
1588 <!-- <input type="checkbox" name="pref_ring_endauct" id="pref_ring_endauct" onclick="pref_ring_endauct_set(this);"><?php /* echo $mlang_room['itm_ringauc'][$G_lang]; */ ?> -->
1589 </div>
1590 </div>
1591 <div class="notify_clo">
1592 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1593 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1594 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1595 </div>
1596 </div>
1597 <script language="JavaScript">
1598 <!--
1599 cookie_law(null);
1600 // -->
1601 </script>
1602 </body>
1603 </html>
1604 <?php
1605     }
1606 }
1607 ?>