typo fixed
[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' => 'visualizza',
130                                              'en' => 'visualize'),
131                      'list_desc'    => array('it' => 'imposta le regole di ascolto',
132                                              'en' => 'set the listen rules'),
133                      'tit_listall'  => array('it' => 'tutti gli utenti',
134                                              'en' => 'everybody'),
135                      'listall_desc' => array('it' => 'visualizza tutti gli utenti collegati',
136                                              'en' => 'visualize all connected users'),
137                      'tit_listisol'  => array('it' => 'solo gli user autenticati',
138                                              'en' => 'authenticated users only'),
139                      'listisol_desc' => array('it' => 'visualizza solo gli user autenticati e i tavoli a loro riservati',
140                                              'en' => 'visualize authenticated users only and reserved tables to them'),
141                      'suppcomp_tit' =>  array('it' => 'personalizza la tua S',
142                                             'en' => 'customize your S'),
143                      'suppcomp_r' =>  array('it' => 'rosso',
144                                             'en' => 'red'),
145                      'suppcomp_g' =>  array('it' => 'verde',
146                                             'en' => 'green'),
147                      'suppcomp_b' =>  array('it' => 'blu',
148                                             'en' => 'blue'),
149                      'suppcomp_fg' =>  array('it' => 'colore',
150                                             'en' => 'color'),
151                      'suppcomp_bg' =>  array('it' => 'sfondo',
152                                             'en' => 'background'),
153                      'suppcomp_range' =>  array('it' => '(0-255)',
154                                             'en' => '(0-255)'),
155                      'tit_splash'   => array('it' => 'splash',
156                                              'en' => 'splash'),
157                      'splash_desc'  => array('it' => 'attiva la finestra di splash',
158                                              'en' => 'show the splash window'),
159                      'tit_prefs'   => array('it' => 'preferenze',
160                                              'en' => 'preferences'),
161                      'prefs_desc'  => array('it' => 'preferenze dell\' utente',
162                                              'en' => 'user\'s preferences'),
163                      'tit_help'     => array('it' => 'informazioni utili su Brisk',
164                                              'en' => 'usefull information about Brisk'),
165                      'itm_help'     => array('it' => 'aiuto',
166                                              'en' => 'help'),
167                      'tit_hpage'    => array('it' => 'homepage del progetto',
168                                              'en' => 'project homepage (ita)'),
169                      'tit_what'     => array('it' => 'di cosa si tratta',
170                                              'en' => 'what is the project'),
171                      'itm_what'     => array('it' => 'cos\'&egrave;',
172                                              'en' => 'what is it'),
173                      'url_rules'    => array('it' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5',
174                                              'en' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5&EN=true'),
175                      'itm_rules'    => array('it' => 'regole',
176                                              'en' => 'rules'),
177                      'tit_rules'    => array('it' => 'come si gioca',
178                                              'en' => 'how to play'),
179                      'tit_shot'     => array('it' => 'screenshots dell\'applicazione',
180                                              'en' => 'screenshots of the web-application'),
181                      'tit_comp'     => array('it' => 'compatibilit&agrave; con i browser',
182                                              'en' => 'browsers compatibility'),
183                      'itm_comp'     => array('it' => 'compatibilit&agrave;',
184                                              'en' => 'compatibility'),
185                      'tit_src'      => array('it' => 'sorgenti dell\'applicazione web',
186                                              'en' => 'sources of the web-application'),
187                      'itm_src'      => array('it' => 'sorgenti',
188                                              'en' => 'sources'),
189                      'tit_ml'       => array('it' => 'come iscriversi alla mailing list',
190                                              'en' => 'how to subscribe the mailing list'),
191                      'itm_ml'       => array('it' => 'mailing&nbsp;list',
192                                              'en' => 'mailing&nbsp;list'),
193                      'tit_pro'      => array('it' => 'come fare pubblicit&agrave; a Brisk!',
194                                              'en' => 'how to spread Brisk!'),
195                      'itm_pro'      => array('it' => 'propaganda',
196                                              'en' => 'propaganda'),
197                      'tit_mail'     => array('it' => 'contatti',
198                                              'en' => 'contacts'),
199                      'itm_mail'     => array('it' => 'contatti',
200                                              'en' => 'contacts'),
201                      'tit_cook'      => array('it' => 'policy sui cookie',
202                                               'en' => 'cookie policy'),
203                      'itm_cook'      => array('it' => 'cookie',
204                                               'en' => 'cookie'),
205                      'tit_dtmg'      => array('it' => 'trattamento dati personali',
206                                               'en' => 'personal data management'),
207                      'itm_dtmg'      => array('it' => 'dati personali',
208                                               'en' => 'personal data'),
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     $transp_port = ((array_key_exists("X-Forwarded-Proto", $header) &&
364                      $header["X-Forwarded-Proto"] == "https") ? 443 : 80);
365
366     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
367         $sess = "";
368     if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
369         unset($name);
370     else
371         log_step("LOGIN: $name");
372
373     if (($pass_private = gpcs_var('pass_private', $get, $post, $cookie)) === FALSE)
374         unset ($pass_private);
375     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
376         unset ($table_idx);
377     if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
378         unset ($table_token);
379
380     // default values
381     $_cookie_law_3party = 'true';
382     if (isset($cookie['_cookie_law_3party']))
383         $_cookie_law_3party = $cookie['_cookie_law_3party'];
384
385     $remote_addr = addrtoipv4($remote_addr_full);
386
387     $is_login = FALSE;
388     $body = "";
389     $tables = "";
390     $standup = "";
391     $ACTION = "login";
392     $last_msg = "";
393     $banned = FALSE;
394
395     if (isset($BRISK_SHOWHTML) == FALSE) {
396         $is_table = FALSE;
397         log_main("lock Brisk");
398         $curtime = time();
399
400         /* Actions */
401         if (($ghost_sess = $brisk->ghost_sess->pop($sess)) != FALSE) {
402             switch ($ghost_sess->reas) {
403             case GHOST_SESS_REAS_LOUT:
404                 $last_msg = $mlang_room['reas_lout'][$G_lang];
405                 break;
406             case GHOST_SESS_REAS_ANOT:
407                 $last_msg = $mlang_room['reas_anot'][$G_lang];
408                 break;
409             case GHOST_SESS_REAS_TOUT:
410                 $last_msg = $mlang_room['reas_tout'][$G_lang];
411                 break;
412             case GHOST_SESS_REAS_TTOT:
413                 $last_msg = $mlang_room['reas_ttot'][$G_lang];
414                 break;
415             case GHOST_SESS_REAS_ANON:
416                 $last_msg = $mlang_room['reas_anon'][$G_lang];
417                 break;
418             case GHOST_SESS_REAS_PROX:
419                 $last_msg = $mlang_room['reas_prox'][$G_lang];
420                 break;
421             default:
422                 $last_msg = $mlang_room['reas_unkn'][$G_lang];
423                 break;
424             }
425         }
426         if ($brisk->cloud_check($remote_addr)) {
427             // TODO: find a way to add a nonblocking sleep(5) here
428             $banned = TRUE;
429             $last_msg = $mlang_room['reas_cloud'][$G_lang];
430         }
431
432
433         if (validate_sess($sess)) {
434             log_main("pre garbage_manager UNO");
435             $brisk->garbage_manager(TRUE);
436             log_main("post garbage_manager");
437             if (($user = $brisk->get_user($sess, $idx)) != FALSE) {
438                 if ($user->the_end == FALSE) {
439                     $brisk->sess_cur_set($user->sess);
440                     log_main("user stat: ".$user->stat);
441                     if ($user->stat == "table") {
442                         $cookies = new Cookies();
443                         $cookies->add("table_token", $user->table_token, $curtime + 31536000);
444                         $cookies->add("table_idx", $user->table, $curtime + 31536000);
445                         $header_out['cookies'] = $cookies;
446                         $header_out['Location'] = "briskin5/index.php";
447                         return TRUE;
448                     }
449                     $ACTION = "room";
450                 }
451             }
452         }
453         if (!$banned && $ACTION == "login" && isset($name)) {
454             log_main("pre garbage_manager DUE");
455
456             if (isset($pass_private) == FALSE || $pass_private == "") {
457                 $pass_private = FALSE;
458
459                 if ($brisk->ban_check($remote_addr)) {
460                     // TODO: find a way to add a nonblocking sleep(5) here
461                     $banned = TRUE;
462                     $idx = -4;
463                 }
464             }
465
466             $brisk->garbage_manager(TRUE);
467             /* try login */
468
469             if ($banned == FALSE &&
470                 ($user = $brisk->add_user($sess, $idx, $name, $pass_private,
471                                           $remote_addr, $header, $cookie)) != FALSE) {
472                 $brisk->sess_cur_set($user->sess);
473                 $ACTION = "room";
474                 if ($idx < 0) {
475                     $idx = -$idx - 1;
476                     $is_login = TRUE;
477                 }
478
479                 log_legal($curtime, $remote_addr, $user, "STAT:LOGIN", '');
480
481                 // recovery lost game
482                 if ($user->stat == "table") {
483                     $cookies = new Cookies();
484                     $cookies->add("table_token", $user->table_token, $curtime + 31536000);
485                     $cookies->add("table_idx", $user->table, $curtime + 31536000);
486                     $header_out['cookies'] = $cookies;
487                     $header_out['Location'] = "briskin5/index.php";
488                     return TRUE;
489                 }
490             }
491             else {
492                 // fprintf(STDERR, "POST CHECK QUI\n");
493                 /* Login Rendering */
494                 switch($idx) {
495                 case -4:
496                     $sfx = 'ban';
497                     break;
498                 case -3:
499                     $sfx = 'err';
500                     break;
501                 case -2:
502                     $sfx = 'must';
503                     break;
504                 case -1:
505                     $sfx = 'end';
506                     break;
507                 default:
508                     $sfx = 'use';
509                 }
510
511                 $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
512             }
513         }
514     }
515     /* Rendering. */
516
517     if ($BRISK_SHOWHTML == "debugtable") {
518         $ACTION = "room";
519     }
520     else if ($BRISK_SHOWHTML == "debuglogin") {
521         $ACTION = "login";
522     }
523
524     if ($ACTION == "room") {
525         $tables .= '<div class="room_tab">';
526         $tables .= '<table class="room_tab">';
527
528         $direct = ($user->is_auth() && !$user->is_appr());
529         for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
530             if ($direct)
531                 $i = $ii;
532             else
533                 $i = TABLES_N - $ii - 1;
534
535             if ($ii % 4 == 0) {
536                 if ($direct) {
537                     $noauth_class = ($i + 3 < TABLES_APPR_N ? "" : "noauth");
538                 }
539                 else {
540                     $noauth_class = ($i < TABLES_APPR_N ? "" : "noauth");
541                 }
542                 $tables .= sprintf('<tr class="%s">', $noauth_class);
543             }
544
545             $noauth_class = ($i < TABLES_APPR_N ? "" : "noauth");
546             $tables .= sprintf('<td class="%s">', $noauth_class);
547
548             $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
549             $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
550             $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
551             $tables .= '</div>';
552             $tables .= '</td>'."\n";
553
554             if ($ii % 4 == 3) {
555                 $tables .= '</tr>';
556             }
557         }
558         $tables .= '</table></div>';
559
560         $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
561         $standup .= '<div class="room_ex_standup">';
562         /* MLANG: "Giocatori in piedi" */
563         // $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>';
564         $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
565
566         $standup .= sprintf('<div id="standup" class="room_standup"></div>');
567         // MLANG Esco.
568         $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>';
569         $standup .= '</div></td></tr></table>';
570     }
571
572     $altout_sponsor_arr = array( array ( 'id' => 'btn_altout',
573                                          'url' => 'http://www.alternativeoutput.it',
574                                          'content' => 'img/altout80x15.png',
575                                          'content_big' => 'img/logotxt_banner.png'),
576                                  array ( 'id' => 'btn_virtualsky',
577                                          'url' => 'http://virtualsky.alternativeoutput.it',
578                                          'content' => 'img/virtualsky80x15a.gif',
579                                          'content_big' => 'img/virtualsky_big.png'),
580                                  array ( 'id' => 'btn_dynamica',
581                                          'url' => 'http://www.dynamica.it',
582                                          'content' => 'img/dynamica.png',
583                                          'content_big' => 'img/dynamica_big.png')
584                                  );
585
586     $altout_support_arr = array( array ( 'id' => 'btn_brichi',
587                                          'url' => 'http://www.briscolachiamata.it',
588                                          'content' => 'img/brichi.png',
589                                          'content_big' => 'img/brichi_big.png'),
590                                  array ( 'id' => 'btn_foroli',
591                                          'url' => 'http://www.forumolimpia.it',
592                                          'content' => 'img/forumolimpia.gif',
593                                          'content_big' => 'img/forumolimpia_big.png' ),
594                                  array ( 'id'=> 'btn_niini',
595                                          'url' => 'http://www.niinivirta.it',
596                                          'content' => 'img/niinivirta.png',
597                                          'content_big' => 'img/niinivirta_big.png') );
598
599
600
601     $altout_support = "";
602     $altout_support_big = "";
603     for ($i = 0 ; $i < 4 ; $i++) {
604         $ii = ($i < 3 ? $i : 0);
605
606         $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",
607                                    $i * 20, $altout_support_arr[$ii]['url'],
608                                    $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
609
610         $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
611                                        $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
612     }
613
614
615     // seed with microseconds since last "whole" second
616     // srand ((double) microtime() * 1000000);
617     // $randval = rand(0,count($altout_sponsor_arr)-1);
618     $altout_sponsor = "";
619     $altout_sponsor_big = "";
620     for ($i = 0 ; $i < 4 ; $i++) {
621         $ii = ($i < 3 ? $i : 0);
622
623         $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",
624                                    $i * 20, $altout_sponsor_arr[$ii]['url'],
625                                    $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
626
627         $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
628                                        $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']);
629     }
630
631
632
633     /* NOTE: Brisk donate or donate fake if local */
634     if (!$G_is_local)
635         $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
636     else
637         $brisk_donate = '<div style="background-color: #ff0; height: 27px; margin-top: 4px;">BRISK_DONATE</div>';
638
639     if ($brisk_donate == FALSE)
640         $brisk_donate = "";
641
642
643     /* MLANG: "briscola chiamata in salsa ajax", */
644
645     mt_srand(make_seed());
646     if (!$G_is_local && $_cookie_law_3party == 'true') {
647         $rn = rand(0, 1);
648
649         if ($rn == 0) {
650             $banner_top_left = '<script type="text/javascript"><!--
651 google_ad_client = "pub-5246925322544303";
652 google_ad_width = 234;
653 google_ad_height = 60;
654 google_ad_format = "234x60_as";
655 google_ad_type = "text_image";
656 google_ad_channel = "";
657 google_color_border = "808080";
658 google_color_bg = "f6f6f6";
659 google_color_link = "ffae00";
660 google_color_text = "404040";
661 google_color_url = "000000";
662 //-->
663 </script>
664 <script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
665             $banner_top_right = carousel_top();
666         }
667         else {
668             $banner_top_left = carousel_top();
669             $banner_top_right = '<script type="text/javascript"><!--
670 google_ad_client = "pub-5246925322544303";
671 google_ad_width = 234;
672 google_ad_height = 60;
673 google_ad_format = "234x60_as";
674 google_ad_type = "text_image";
675 google_ad_channel = "";
676 google_color_border = "808080";
677 google_color_bg = "f6f6f6";
678 google_color_link = "ffae00";
679 google_color_text = "404040";
680 google_color_url = "000000";
681 //-->
682 </script>
683 <script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
684         }
685     }
686     else { // !$G_is_local
687         $banner_top_left  = carousel_top();
688         $banner_top_right = carousel_top();
689     }
690
691     $brisk_header_form = '<div class="container">
692 <!-- =========== header ===========  -->
693 <div id="header" class="header">
694 <table width="100%%" style="min-height: 84px;" border="0" cols="3"><tr>
695 <td style="width: 33%%;" align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
696 <td style="width: 34%%;" align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
697  <img class="nobo" src="img/brisk_logo64.png">'
698 /*    <img class="nobo" src="img/brisk_logo64_blackribbon.png" title="ciao Prof" alt="ciao Prof">' */
699     .$mlang_room['headline'][$G_lang].'<br>
700     </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>',
701                                                                 ($G_with_topbanner ? $G_topbanner :
702 "<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>
703 <td style="width: 33%%;" align="right"><div style="padding-right: 8px;">'.$banner_top_right.'</div></td>
704 </tr></table>
705 </div>';
706 // <td style="width: 33%%;" align="right">'.$banner_top_right.'</td>
707
708     /* MLANG: ALL THE VERTICAL MENU */
709     $brisk_vertical_menu = '
710 <!--  =========== vertical menu ===========  -->
711 <div class="topmenu">
712 <!-- <a target="_blank" href="/briskhome.php"></a> -->
713
714 <div class="webstart_hilite">
715 <img class="nobo" style="cursor: pointer;" src="img/brisk_start.png" onmouseover="menu_hide(0,0); menu_show(\'menu_webstart\');">
716 <div class="webstart" id="menu_webstart" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
717
718 <a href="#" onmouseover="menu_hide(0,1);" title="'.$mlang_room['tit_help'][$G_lang].'" onclick="act_help();"
719    >'.$mlang_room['itm_help'][$G_lang].'</a><br>
720
721 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php"
722    onmouseover="menu_hide(0,1);"
723    title="'.$mlang_room['tit_hpage'][$G_lang].'">homepage</a><br>
724
725 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#cose"
726    onmouseover="menu_hide(0,1);"
727    title="'.$mlang_room['tit_what'][$G_lang].'">'.$mlang_room['itm_what'][$G_lang].'</a><br>
728
729 <a target="_blank" href="'.$mlang_room['url_rules'][$G_lang].'"
730    onmouseover="menu_hide(0,1);"
731    title="'.$mlang_room['tit_rules'][$G_lang].'">'.$mlang_room['itm_rules'][$G_lang].'</a><br>
732
733 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#shots"
734    onmouseover="menu_hide(0,1);"
735    title="'.$mlang_room['tit_shot'][$G_lang].'">screenshoots</a><br>
736
737 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#comp"
738    onmouseover="menu_hide(0,1);"
739    title="'.$mlang_room['tit_comp'][$G_lang].'">'.$mlang_room['itm_comp'][$G_lang].'</a><br>
740
741 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#sources"
742    onmouseover="menu_hide(0,1);"
743    title="'.$mlang_room['tit_src'][$G_lang].'">'.$mlang_room['itm_src'][$G_lang].'</a><br>
744
745 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#mailing"
746    onmouseover="menu_hide(0,1);"
747    title="'.$mlang_room['tit_ml'][$G_lang].'">'.$mlang_room['itm_ml'][$G_lang].'</a><br>
748
749 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#prop"
750    onmouseover="menu_hide(0,1);"
751    title="'.$mlang_room['tit_pro'][$G_lang].'">'.$mlang_room['itm_pro'][$G_lang].'</a><br>
752 <a href="#"
753    onmouseover="menu_hide(0,1);"
754    title="credits" onclick="act_about();">about</a><br>
755
756 <a href="mailto:brisk@alternativeoutput.it"
757    onmouseover="menu_hide(0,1);"
758    title="'.$mlang_room['tit_mail'][$G_lang].'">'.$mlang_room['itm_mail'][$G_lang].'</a><br>
759
760 <a target="_blank" href="http://www.alternativeoutput.it/cookie.php"
761    onmouseover="menu_hide(0,1);"
762    title="'.$mlang_room['tit_cook'][$G_lang].'"
763    alt="'.$mlang_room['tit_cook'][$G_lang].'">'.$mlang_room['itm_cook'][$G_lang].'</a><br>
764
765 <a target="_blank" href="http://www.alternativeoutput.it/personal_data.php"
766    onmouseover="menu_hide(0,1);"
767    title="'.$mlang_room['tit_dtmg'][$G_lang].'"
768    alt="'.$mlang_room['tit_dtmg'][$G_lang].'">'.$mlang_room['itm_dtmg'][$G_lang].'</a><br>
769 <hr>
770
771 <a href="#"
772    onmouseover="menu_hide(0,1);"
773    title="'.$mlang_room['tit_cla'][$G_lang].'" onclick="act_placing();">'.$mlang_room['itm_cla'][$G_lang].'</a><br>
774
775 <a target="_blank" href="briskin5/explain.php"
776    onmouseover="menu_hide(0,1);"
777    title="'.$mlang_room['tit_mnu'][$G_lang].'">'.$mlang_room['itm_mnu'][$G_lang].'</a><br>
778
779 <a href="#"
780    onmouseover="menu_hide(0,1);"
781    title="'.$mlang_room['tit_rmap'][$G_lang].'" onclick="act_roadmap();">'.$mlang_room['itm_rmap'][$G_lang].'</a><br>
782
783 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'"
784    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
785
786 <div style="text-align: right;" id="menu_meeting" class="webstart">
787 <a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
788    target="_blank" onmouseover="menu_hide(0,2);"
789    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>
790
791 <a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
792    target="_blank" onmouseover="menu_hide(0,2);"
793    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>
794
795 <a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
796    target="_blank" onmouseover="menu_hide(0,2);"
797    title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
798
799 <a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
800    target="_blank" onmouseover="menu_hide(0,2);"
801    title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
802
803 <a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
804    target="_blank" onmouseover="menu_hide(0,2);"
805    title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
806
807 <a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1"
808    target="_blank" onmouseover="menu_hide(0,2);"
809    title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
810
811 <a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1"
812    target="_blank" onmouseover="menu_hide(0,2);"
813    title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
814
815 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806"
816    target="_blank" onmouseover="menu_hide(0,2);"
817    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
818
819 <a href="http://www.anomalia.it/mop/photoo"
820    target="_blank" onmouseover="menu_hide(0,2);"
821    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
822
823 </div>
824 </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\');">
825
826 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
827
828 <a href="#" title="'
829           // MLANG
830           .$mlang_room['tit_stat'][$G_lang].
831 '"
832    onmouseover="menu_hide(0,1); menu_show(\'menu_state\');">'
833           // MLANG
834           .$mlang_room['stat_desc'][$G_lang].
835 '</a><br>
836 <div id="menu_state" class="webstart">
837 <a href="#"
838    onmouseover="menu_hide(0,2);"
839    title="" onclick="act_chatt(\'/st normale\'); menu_over(-1,this);">'
840           // MLANG
841           .$mlang_room['st_norm_desc'][$G_lang].
842 '</a><br>
843
844 <a href="#"
845    onmouseover="menu_hide(0,2);"
846    title="" onclick="act_chatt(\'/st pausa\'); menu_over(-1,this);">'
847           // MLANG
848           .$mlang_room['st_paus_desc'][$G_lang].
849 '&nbsp;<img class="unbo" src="img/st_pau.png"></a><br>
850
851 <a href="#"
852    onmouseover="menu_hide(0,2);"
853    title="" onclick="act_chatt(\'/st fuori\'); menu_over(-1,this);">'
854           // MLANG
855           .$mlang_room['st_out_desc'][$G_lang].
856 '&nbsp;<img class="unbo" src="img/st_out.png"></a><br>
857
858 <a href="#"
859    onmouseover="menu_hide(0,2);"
860    title="" onclick="act_chatt(\'/st cane\'); menu_over(-1,this);">'
861           // MLANG
862           .$mlang_room['st_dog_desc'][$G_lang].
863 '&nbsp;<img class="unbo" src="img/st_dog.png"></a><br>
864
865 <a href="#"
866    onmouseover="menu_hide(0,2);"
867    title="" onclick="act_chatt(\'/st cibo\'); menu_over(-1,this);">'
868           // MLANG
869           .$mlang_room['st_food_desc'][$G_lang].
870 '&nbsp;<img class="unbo" src="img/st_eat.png"></a><br>
871
872 <a href="#"
873    onmouseover="menu_hide(0,2);"
874    title="" onclick="act_chatt(\'/st lavoro\'); menu_over(-1,this);">'
875           // MLANG
876           .$mlang_room['st_work_desc'][$G_lang].
877 '&nbsp;<img class="unbo" src="img/st_wrk.png"></a><br>
878
879 <a href="#"
880    onmouseover="menu_hide(0,2);"
881    title="" onclick="act_chatt(\'/st sigaretta\'); menu_over(-1,this);">'
882           // MLANG
883           .$mlang_room['st_smok_desc'][$G_lang].
884 '&nbsp;<img class="unbo" src="img/st_smk.png"></a><br>
885
886 <a href="#"
887    onmouseover="menu_hide(0,2);"
888    title="" onclick="act_chatt(\'/st presente\'); menu_over(-1,this);">'
889           // MLANG
890           .$mlang_room['st_pres_desc'][$G_lang].
891 '&nbsp;<img class="unbo" src="img/st_eye.png"></a><br>
892
893 <a href="#"
894    onmouseover="menu_hide(0,2);"
895    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
896           // MLANG
897           .$mlang_room['st_rabb_desc'][$G_lang].
898 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
899
900 <a href="#"
901    onmouseover="menu_hide(0,2);"
902    title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
903           // MLANG
904           .$mlang_room['st_socc_desc'][$G_lang].
905 '&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
906
907 <a href="#"
908    onmouseover="menu_hide(0,2);"
909    title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
910           // MLANG
911           .$mlang_room['st_baby_desc'][$G_lang].
912 '&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
913
914 <a href="#"
915    onmouseover="menu_hide(0,2);"
916    title="" onclick="act_chatt(\'/st pulizie\'); menu_over(-1,this);">'
917           // MLANG
918           .$mlang_room['st_mop_desc'][$G_lang].
919 '&nbsp;<img class="unbo" src="img/st_mop.png"></a><br>
920
921 <a href="#"
922    onmouseover="menu_hide(0,2);"
923    title="" onclick="act_chatt(\'/st babbo\'); menu_over(-1,this);">'
924           // MLANG
925           .$mlang_room['st_babbo_desc'][$G_lang].
926 '&nbsp;<img class="unbo" src="img/st_babbo.png"></a><br>
927
928 <a href="#"
929    onmouseover="menu_hide(0,2);"
930    title="" onclick="act_chatt(\'/st renna\'); menu_over(-1,this);">'
931           // MLANG
932           .$mlang_room['st_renna_desc'][$G_lang].
933 '&nbsp;<img class="unbo" src="img/st_renna.png"></a><br>
934
935 <a href="#"
936    onmouseover="menu_hide(0,2);"
937    title="" onclick="act_chatt(\'/st pupazzo\'); menu_over(-1,this);">'
938           // MLANG
939           .$mlang_room['st_pupaz_desc'][$G_lang].
940 '&nbsp;<img class="unbo" src="img/st_pupaz.png"></a><br>
941
942 <a href="#"
943    onmouseover="menu_hide(0,2);"
944    title="" onclick="act_chatt(\'/st vischio\'); menu_over(-1,this);">'
945           // MLANG
946           .$mlang_room['st_visch_desc'][$G_lang].
947 '&nbsp;<img class="unbo" src="img/st_visch.png"></a><br>
948
949 </div>
950
951 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo"
952    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>
953
954 <a href="#" title="'
955           // MLANG garantisci per un tuo conoscente
956           .$mlang_room['warr_desc'][$G_lang].
957 '"
958    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/authreq\'); menu_over(-1,this);">'
959           // MLANG garantisci
960           .$mlang_room['itm_warr'][$G_lang].
961           '</a><br>
962
963
964
965 <a href="#" title="'
966           // MLANG garantisci per un tuo conoscente
967           .$mlang_room['splash_desc'][$G_lang].
968 '"
969    onmouseover="menu_hide(0,1);" onclick="act_splash(); menu_over(-1,this);">'
970           // MLANG garantisci
971           .$mlang_room['tit_splash'][$G_lang].
972           '</a><br>
973 '.($user->is_auth() ? '
974 <a href="#" title="'
975           // MLANG garantisci per un tuo conoscente
976           .$mlang_room['prefs_desc'][$G_lang].'"
977    onmouseover="menu_hide(0,1);" onclick="$(\'preferences\').style.visibility = \'visible\'; menu_over(-1,this);">'
978           // MLANG garantisci
979    .$mlang_room['tit_prefs'][$G_lang].'</a><br>' : '').'
980
981 </div>'.($G_with_poll ? '' : '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
982 <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();">').'
983 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
984 '.($user->flags & USER_FLAG_AUTH ? '
985 <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()
986  : '
987 <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();">
988 ').'
989
990 ' : '').'
991
992 </div>
993 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
994 sponsored by:<br>
995 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
996 <div id="spon_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */ ">
997 <div style="/*background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_sponsor.'<br>
998 </div></div>
999 <div style="position: absolute;">
1000 '.$altout_sponsor_big.'
1001 </div>
1002 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
1003 supported by:<br>
1004 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
1005 <div id="supp_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */">
1006 <div style="/* background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_support.'<br>
1007
1008 </div>
1009 </div>
1010 <div style="position: absolute;">
1011 '.$altout_support_big.'
1012 </div>
1013 <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>
1014 ' . ( /* NOTE: here facebook or fake facebook */
1015 (!$G_is_local && $_cookie_law_3party == 'true') ?
1016 '<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>
1017 ' : '' ) . '<div id="proaudioext" class="proaudioext"><div id="proaudio" class="proaudio"></div></div>
1018 <img id="stm_stat" class="nobo" style="margin-top: 4px;" src="img/line-status_b.png">
1019 %s
1020 %s
1021 </div>';
1022
1023     /* Templates. */
1024     if ($ACTION == 'login') {
1025         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1026 ?>
1027 <html>
1028 <head>
1029 <title>Brisk</title>
1030 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1031 <link rel="shortcut icon" href="img/brisk_ico.png">
1032 <script src="//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
1033 <script type="text/javascript" src="commons.js?v=<? echo BSK_BUSTING; ?>"></script>
1034 <script type="text/javascript" src="fieldify.js?v=<? echo BSK_BUSTING; ?>"></script>
1035 <script type="text/javascript" src="prefs.js?v=<? echo BSK_BUSTING; ?>"></script>
1036 <script type="text/javascript" src="info.js?v=<? echo BSK_BUSTING; ?>"></script>
1037 <!-- <script type="text/javascript" src="myconsole.js?v=<? echo BSK_BUSTING; ?>"></script> -->
1038 <script type="text/javascript" src="menu.js?v=<? echo BSK_BUSTING; ?>"></script>
1039 <script type="text/javascript" src="heartbit.js?v=<? echo BSK_BUSTING; ?>"></script>
1040 <script type="text/javascript" src="xynt-streaming.js?v=<? echo BSK_BUSTING; ?>"></script>
1041 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js?v=<? echo BSK_BUSTING; ?>"></script>
1042 <script type="text/javascript" src="room.js?v=<? echo BSK_BUSTING; ?>"></script>
1043 <script type="text/javascript" src="md5.js?v=<? echo BSK_BUSTING; ?>"></script>
1044 <script type="text/javascript" src="probrowser.js?v=<? echo BSK_BUSTING; ?>"></script>
1045 <script type="text/javascript" src="json2.js?v=<? echo BSK_BUSTING; ?>"></script>
1046 <script type="text/javascript" src="/cookie_law.js?v=<? echo BSK_BUSTING; ?>"></script>
1047 <link rel="stylesheet" type="text/css" href="/cookie_law.css?v=<? echo BSK_BUSTING; ?>">
1048 <link rel="stylesheet" type="text/css" href="brisk.css?v=<? echo BSK_BUSTING; ?>">
1049 <link rel="stylesheet" type="text/css" href="room.css?v=<? echo BSK_BUSTING; ?>">
1050
1051 <script type="text/javascript"><!--
1052 var $$ = jQuery.noConflict();
1053
1054 var myname = null;
1055 var g_debug = 0;
1056 var g_lang = "<? echo $G_lang; ?>";
1057 var g_lng = "<? echo $G_lng; ?>";
1058 var g_tables_n = <? echo TABLES_N; ?>;
1059 var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1060 var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1061 var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1062 var g_prefs, g_prefs_new = null;
1063 var g_jukebox = null;
1064 var g_is_spawn = 0;
1065 var g_nd = null;
1066 var g_brow = null;
1067 var gst  = new globst();
1068 var topbanner_sfx, topbanner_dx;
1069 var xstm = null;
1070 var sess = "not_connected";
1071 var spo_slide, sup_slide;
1072
1073 window.onload = function() {
1074     // alert(window.onbeforeunload);
1075     g_brow = get_browser_agent();
1076
1077     g_prefs = new client_prefs(null);
1078
1079     spo_slide  = new sideslide($('spon_caro'), 80, 20);
1080     sup_slide  = new sideslide($('supp_caro'), 80, 20);
1081
1082     login_init();
1083     <?php
1084         if ($G_with_topbanner) {
1085             printf("    topbanner_init();\n");
1086         }
1087     sidebanners_init($G_sidebanner_idx);
1088     ?>
1089
1090     g_jukebox = new jukebox([]);
1091     if (g_jukebox.is_enabled() == false) {
1092         $("proaudio").innerHTML = 'Audio HTML5 non supportato.';
1093     }
1094     else {
1095         $("proaudioext").innerHTML = "";
1096     }
1097     $("nameid").focus();
1098 }
1099 //-->
1100 </script>
1101 </head>
1102 <?php
1103         if (!$G_is_local && $_cookie_law_3party == 'true') {
1104 ?>
1105 <!-- if myconsole <body onunload="deconsole();"> -->
1106 <body xmlns:fb="http://ogp.me/ns/fb#">
1107 <div id="fb-root"></div>
1108 <script type="text/javascript"><!--
1109 (function(d, s, id) {
1110     var js, fjs = d.getElementsByTagName(s)[0];
1111     if (d.getElementById(id)) return;
1112     js = d.createElement(s); js.id = id;
1113     js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1114     fjs.parentNode.insertBefore(js, fjs);
1115 }(document, 'script', 'facebook-jssdk'));</script>
1116 <?php
1117         }
1118         else {
1119 ?>
1120 <body>
1121 <?php
1122         }
1123         printf($brisk_header_form);
1124         printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1125         printf($brisk_vertical_menu, '', '');
1126
1127         sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1128         printf("</td><td>");
1129 ?>
1130
1131 <!--  =========== tables ===========  -->
1132 <?php
1133
1134 /* 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)" */
1135         echo "$body";
1136 ?>
1137     <br>
1138     <div style="text-align: center;">
1139     <br>
1140         <div class="bye_msg" id="bye_msg"><?php echo "$last_msg"; ?></div>
1141     <br>
1142 <?php echo $mlang_room['welcome'][$G_lang];?>
1143     <br><br>
1144     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_login_manager(this);">
1145     <input id="passid_private" name="pass_private" type="hidden" value="">
1146     <table class="login">
1147     <tr><td>nickname:</td>
1148     <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1149     <tr><td>password:</td>
1150     <td><input id="passid" class="input_text" name="pass" type="password" size="24" maxlength="64" value=""></td></tr>
1151     <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_enter'][$G_lang];?>" type="submit" class="button"></td></tr>
1152     </table>
1153     </form><br>
1154
1155     <?php echo $mlang_room['passwarn'][$G_lang];?><br><br>
1156
1157          <button onclick="$('apprentice_div').style.display = ($('apprentice_div').style.display == 'none' ? 'inline-block' : 'none');">Vuoi ottenere un accesso da apprendista ?</button><br><br>
1158              <div id="apprentice_div" style="display: none;" class="apprentice">
1159          <br>
1160          Inserisci il tuo nickname e il tuo indirizzo e-mail.<br>
1161          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>
1162     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_new_apprentice(this);">
1163     <input type="hidden" name="realsub" value="666">
1164     <table class="login">
1165     <tr><td>nickname:</td>
1166     <td><input id="nameid" class="input_text" name="cli_name" type="text" size="24" maxlength="12" value=""></td></tr>
1167     <tr><td>e-mail:</td>
1168     <td><input id="emailid" class="input_text" name="cli_email" type="text" size="24" maxlength="512" value=""></td></tr>
1169                                                                           <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>
1170         <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>
1171     </table>
1172     </form></div>
1173          <br><br>
1174 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
1175     </div>
1176
1177     <div id="imgct"></div>
1178     <div id="logz"></div>
1179     <div id="sandbox"></div>
1180     <div id="sandbox2"></div>
1181     <div id="response"></div>
1182     <div id="xhrstart"></div>
1183     <pre>
1184     <div id="xhrlog"></div>
1185     </pre>
1186     <div id="xhrdeltalog"></div>
1187
1188 <script language="JavaScript">
1189 <!--
1190 cookie_law(null);
1191 // -->
1192 </script>
1193 </body>
1194 </html>
1195 <?php
1196     }
1197     else if ($ACTION == 'room') {
1198         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1199 ?>
1200 <html>
1201 <head>
1202 <title>Brisk</title>
1203 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1204 <link rel="shortcut icon" href="img/brisk_ico.png">
1205 <script src="//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
1206 <script type="text/javascript" src="commons.js?v=<? echo BSK_BUSTING; ?>"></script>
1207 <script type="text/javascript" src="fieldify.js?v=<? echo BSK_BUSTING; ?>"></script>
1208 <script type="text/javascript" src="prefs.js?v=<? echo BSK_BUSTING; ?>"></script>
1209 <script type="text/javascript" src="info.js?v=<? echo BSK_BUSTING; ?>"></script>
1210 <!-- <script type="text/javascript" src="myconsole.js?v=<? echo BSK_BUSTING; ?>"></script> -->
1211 <script type="text/javascript" src="menu.js?v=<? echo BSK_BUSTING; ?>"></script>
1212 <script type="text/javascript" src="ticker.js?v=<? echo BSK_BUSTING; ?>"></script>
1213 <script type="text/javascript" src="heartbit.js?v=<? echo BSK_BUSTING; ?>"></script>
1214 <script type="text/javascript" src="xynt-streaming.js?v=<? echo BSK_BUSTING; ?>"></script>
1215 <script type="text/javascript" src="room.js?v=<? echo BSK_BUSTING; ?>"></script>
1216 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js?v=<? echo BSK_BUSTING; ?>"></script>
1217 <script type="text/javascript" src="probrowser.js?v=<? echo BSK_BUSTING; ?>"></script>
1218 <script type="text/javascript" src="json2.js?v=<? echo BSK_BUSTING; ?>"></script>
1219 <script type="text/javascript" src="/cookie_law.js?v=<? echo BSK_BUSTING; ?>"></script>
1220 <link rel="stylesheet" type="text/css" href="/cookie_law.css?v=<? echo BSK_BUSTING; ?>">
1221 <link rel="stylesheet" type="text/css" href="brisk.css?v=<? echo BSK_BUSTING; ?>">
1222 <link rel="stylesheet" type="text/css" href="room.css?v=<? echo BSK_BUSTING; ?>">
1223 <script type="text/javascript"><!--
1224    var $$ = jQuery.noConflict();
1225
1226    var sess = "not_connected";
1227    var g_debug = 0;
1228    var g_lang = "<? echo $G_lang; ?>";
1229    var g_lng = "<? echo $G_lng; ?>";
1230    var g_tables_n = <? echo TABLES_N; ?>;
1231    var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1232    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1233    var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1234    var g_prefs, g_prefs_new = null;
1235    var g_is_spawn = 0;
1236    var g_jukebox = null;
1237    var g_imgct = 0;
1238    var g_imgtot = g_preload_img_arr.length;
1239    var g_brow = null;
1240    var g_nd = null;
1241    var tra = null;
1242    var stat = "";
1243    var subst = "";
1244    var gst  = new globst();
1245    var topbanner_sfx, topbanner_dx;
1246    // var nonunload = false;
1247    var spo_slide, sup_slide;
1248
1249    window.onload = function() {
1250      g_brow = get_browser_agent();
1251
1252      g_prefs = new client_prefs(null);
1253
1254      spo_slide  = new sideslide($('spon_caro'), 80, 20);
1255      sup_slide  = new sideslide($('supp_caro'), 80, 20);
1256
1257 <?php
1258         if ($BRISK_SHOWHTML == "debugtable") {
1259 ?>
1260      room_checkspace(12, <?php echo TABLES_N; ?>, 50);
1261 <?php
1262         }
1263         else {
1264 ?>
1265     // alert("INDEX START");
1266      menu_init();
1267 <?php
1268         if ($G_with_topbanner) {
1269             printf("     topbanner_init();\n");
1270         }
1271         sidebanners_init($G_sidebanner_idx);
1272 ?>
1273      sess = "<?php echo "$sess"; ?>";
1274      xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
1275      xstm.hbit_set(heartbit);
1276      tra = new train($('room_tit'));
1277      window.onunload = onunload_cb;
1278      window.onbeforeunload = onbeforeunload_cb;
1279      g_jukebox = new jukebox([]);
1280      if (g_jukebox.is_enabled() == false) {
1281          $("proaudio").innerHTML = 'Audio HTML5 non supportato.';
1282      }
1283      else {
1284          $("proaudioext").innerHTML = "";
1285      }
1286
1287      // console.log("session from main: "+sess);
1288      xstm.start();
1289      // alert("ARR LENGTH "+g_preload_img_arr.length);
1290      // FIXME: preload image will be fired by stream instead here
1291      // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
1292      $("txt_in").focus();
1293 <?php
1294         if ($is_login) {
1295   /* 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" */
1296             echo show_notify($mlang_room['regwarn'][$G_lang], 0, $mlang_room['btn_rettabs'][$G_lang], 400, 150);
1297         }
1298     }
1299 ?>
1300 }
1301 //-->
1302 </script>
1303 </head>
1304 <?php
1305     if (!$G_is_local && $_cookie_law_3party == 'true') {
1306 ?>
1307 <!-- if myconsole <body onunload="deconsole();"> -->
1308 <body xmlns:fb="http://ogp.me/ns/fb#">
1309 <div id="fb-root"></div>
1310 <script>(function(d, s, id) {
1311   var js, fjs = d.getElementsByTagName(s)[0];
1312   if (d.getElementById(id)) return;
1313   js = d.createElement(s); js.id = id;
1314   js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1315   fjs.parentNode.insertBefore(js, fjs);
1316 }(document, 'script', 'facebook-jssdk'));</script>
1317 <?php
1318     }
1319     else {
1320 ?>
1321 <body>
1322 <?php
1323     }
1324     printf($brisk_header_form);
1325     printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1326     printf($brisk_vertical_menu, '', $brisk_donate);
1327
1328     sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1329
1330     printf("</td><td>");
1331 ?>
1332 <!--  =========== tables ===========  -->
1333 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
1334 <table class="macro"><tr><td>
1335 <?php echo "$tables";?>
1336 </td></tr><tr><td>
1337 <?php echo "$standup";?>
1338 </td></tr></table>
1339 </td></tr></table>
1340
1341 <!--  =========== bottom ===========  -->
1342 <div id="bottom" class="bottom">
1343 <b>Chat</b> <span id="list_info" style="color: red;"></span><br>
1344 <div id="txt" class="chatt">
1345 </div>
1346 <div style="text-align: center; ">
1347     <!-- MLANG: scrivi un invito al tavolo e clicca -->
1348     <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;">
1349     <div id="myname"></div>
1350     </td><td>
1351     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
1352     </td></tr></table>
1353 </div>
1354 </div>
1355
1356     <div id="authbox" class="notify" style="text-align: center;">
1357        <br>
1358        <b>
1359     <!-- MLANG: Garantisci per un tuo conoscente: -->
1360 <?php echo $mlang_room['tit_warr'][$G_lang];?>
1361 </b>
1362        <br><br>
1363
1364        <form id="auth_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_authbox(this);">
1365        <input type="hidden" name="realsub" value="666">
1366 <table class="login">
1367 <tr><td>nickname:</td>
1368 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1369 <tr><td>e-mail:</td>
1370 <td><input id="emailid" class="input_text" name="email" type="text" size="24" maxlength="1024" value=""></td></tr>
1371 <tr><td colspan="2" style="text-align: center;">
1372     <!-- MLANG: Garantisci per un tuo conoscente: -->
1373        <input id="subid" name="sub" value=
1374 "<?php echo $mlang_room['btn_send'][$G_lang]; ?>"
1375  type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1376     <!-- MLANG: Garantisci per un tuo conoscente: -->
1377 <input id="cloid" name="clo" value=
1378 "<?php echo $mlang_room['btn_close'][$G_lang]; ?>"
1379 type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1380 </table>
1381     </form>
1382     </div>
1383     <div id="mesgtoadmbox" class="notify_opaque" style="text-align: center;">
1384        <br>
1385 <!--MLANG: Invia un messaggio o una segnalazione all\'amministratore: -->
1386        <b><?php echo $mlang_room['mesgtoadm_tit'][$G_lang];?></b>
1387        <br><br>
1388        <form id="mesgtoadm_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_mesgtoadmbox(this);">
1389        <input type="hidden" name="realsub" value="666">
1390 <table class="login">
1391 <!--MLANG: soggetto -->
1392 <tr><td><b><?php echo $mlang_room['mesgtoadm_sub'][$G_lang];?></b></td>
1393 <td><input id="subjid" class="input_text" name="subj" type="text" size="32" maxlength="255" value=""></td></tr></table>
1394 <table class="login">
1395 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
1396 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
1397 <tr><td colspan="2" style="text-align: center;">
1398        <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;
1399 <input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="submit_click(this);"></td></tr>
1400 </table>
1401     </form>
1402     </div>
1403 <div id="heartbit"></div>
1404 <div id="sandbox"></div>
1405 <div id="imgct"></div>
1406 <div id="logz"></div>
1407 <div id="sandbox2"></div>
1408 <div id="response"></div>
1409 <div id="remark"></div>
1410 <div id="xhrstart"></div>
1411 <div id="xhrlog"></div>
1412 <div id="xhrdeltalog"></div>
1413 </div>
1414
1415 <div id="info" class="notify" style="z-index: 200; width: 500px; margin-left: -250px; height: 340px; top: 150px; visibility: hidden;">
1416 <table class="info">
1417
1418 <tr>
1419 <td class="head"><span><?php echo $mlang_room['info_login'][$G_lang]; ?>:</span></td>
1420 <td class="ri b-right data"><span class="login_id"></span></td>
1421 <td class="head"><span><?php echo $mlang_room['info_status'][$G_lang]; ?>:</span></td>
1422 <td class="ri data"><span class="state_id"></span></td>
1423 </tr>
1424
1425 <tr>
1426 <td class="head"><span><?php echo $mlang_room['info_guar'][$G_lang]; ?>:</span></td>
1427 <td class="ri b-right data"><span class="guar_id"></span></td>
1428 <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>
1429 <td class="ri data"><span class="match_id"></span></td>
1430 </tr>
1431
1432 <tr>
1433 <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>
1434 <td class="ri b-right data"><span class="party_id"></span></td>
1435 <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>
1436 <td class="ri data"><span class="game_id"></span></td>
1437 </tr>
1438
1439 <tr class="widefriend_id">
1440 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repfrie'][$G_lang]; ?>:</span></td>
1441 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td>
1442 </tr>
1443
1444 <tr class="widefriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1445 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1446 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1447 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1448
1449 <tr class="narrowfriend_id">
1450 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repbff'][$G_lang]; ?>:</span></td>
1451 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td></tr>
1452
1453 <tr class="narrowfriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1454 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1455 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1456 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1457 <tr><td class="le ri triple" colspan="3"><b><?php echo $mlang_room['info_frie'][$G_lang]; ?></b></td>
1458 <td class="le data triple"><input type="radio" name="friend" class="friend_id" value="black"
1459     onclick="info_onlyifknown_isvisible();">Da evitare</td></tr>
1460 <tr>
1461 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="unknown"
1462     onclick="info_onlyifknown_isvisible();">Sconosciuto</td>
1463 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="test"
1464     onclick="info_onlyifknown_isvisible();">In prova</td>
1465 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="friend"
1466     onclick="info_onlyifknown_isvisible();">Amico</td>
1467 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="bff"
1468     onclick="info_onlyifknown_isvisible();">Amico fidato</td>
1469 </tr>
1470 <tr class="onlyifknown_gid">
1471 <td class="le head"><span><?php echo $mlang_room['info_skill'][$G_lang]; ?>:</span></td>
1472 <td class="data">
1473     <table class="fiverank" style="margin: auto;">
1474        <tr><td class="c1t">1</td>
1475            <td class="c2t">2</td>
1476            <td class="c3t">3</td>
1477            <td class="c4t">4</td>
1478            <td class="c5t">5</td></tr>
1479        <tr><td class="c1b"><input type="radio" name="skill" class="skill_id" value="1"></td>
1480            <td class="c2b"><input type="radio" name="skill" class="skill_id" value="2"></td>
1481            <td class="c3b"><input type="radio" name="skill" class="skill_id" value="3"></td>
1482            <td class="c4b"><input type="radio" name="skill" class="skill_id" value="4"></td>
1483            <td class="c5b"><input type="radio" name="skill" class="skill_id" value="5"></td>
1484        </tr>
1485     </table>
1486 </td>
1487 <td class="le"><b>Credibilità:</b></td>
1488 <td class="data">
1489     <table class="fiverank" style="margin: auto;">
1490        <tr><td class="c1t">1</td>
1491            <td class="c2t">2</td>
1492            <td class="c3t">3</td>
1493            <td class="c4t">4</td>
1494            <td class="c5t">5</td></tr>
1495        <tr><td class="c1b"><input type="radio" name="trust" class="trust_id" value="1"></td>
1496            <td class="c2b"><input type="radio" name="trust" class="trust_id" value="2"></td>
1497            <td class="c3b"><input type="radio" name="trust" class="trust_id" value="3"></td>
1498            <td class="c4b"><input type="radio" name="trust" class="trust_id" value="4"></td>
1499            <td class="c5b"><input type="radio" name="trust" class="trust_id" value="5"></td>
1500        </tr>
1501     </table>
1502 </td></tr>
1503 </table>
1504 <div style="position: absolute; bottom: 8px; margin: auto; width: 100%;">
1505 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('info').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1506 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1507 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1508 </div>
1509
1510 </div>
1511
1512 <div id="preferences" class="notify" style="z-index: 200; width: 600px; margin-left: -300px; height: 240px; top: 150px; visibility: hidden;">
1513 <div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 370px;">
1514
1515 <h2><?php echo $mlang_room['tit_prefs'][$G_lang]; ?></h2>
1516 <table style="margin: auto;"><tr><td style="vertical-align: top;">
1517 <!--#
1518     #  LISTEN
1519     #-->
1520 <div style="float: left; padding: 8px;">
1521 <table style="border: 1px solid gray;"><tr><th style="background-color: #cccccc;">
1522 <?php echo $mlang_room['itm_list'][$G_lang];?>
1523 </th></tr>
1524 <tr><td><input style="vertical-align: bottom;" id="ra_listen_all" type="radio" name="listen" value="0" onclick="prefs_update('listen');" title="'
1525 <?php echo $mlang_room['listall_desc'][$G_lang];?>
1526 '"><span id="list_all">
1527 <?php echo $mlang_room['tit_listall'][$G_lang];?>
1528 </span></td></tr>
1529 <tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="1" onclick="prefs_update('listen');" title="'
1530 <?php echo $mlang_room['listisol_desc'][$G_lang];?>
1531 '"><span id="list_isol">
1532 <?php echo $mlang_room['tit_listisol'][$G_lang];?>
1533 </span></td></tr>
1534 </table>
1535 </div>
1536 <?php
1537     if ($user->is_supp_custom()) {
1538 ?>
1539 </td>
1540 <td style="vertical-align: top;">
1541 <!--#
1542     #  SUPPORTER ONLY
1543     #-->
1544 <div style="float: left; padding: 8px;">
1545 <table style="border: 1px solid gray;"><tr><th colspan="4" style="background-color: #cccccc;">
1546 <?php echo $mlang_room['suppcomp_tit'][$G_lang];?>
1547 </th></tr>
1548 <tr>
1549 <th>
1550 <?php echo $mlang_room['suppcomp_fg'][$G_lang];?>
1551 </th><td><input style="width: 3em;" id="s_fg_r" type="text" maxlength="3" size="3" name="s_fg_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_fg_g" type="text" maxlength="3" size="3" name="s_fg_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_fg_b" type="text" maxlength="3" size="3" name="s_fg_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>
1565 <th>
1566 <?php echo $mlang_room['suppcomp_bg'][$G_lang];?>
1567 </th>
1568 <td><input style="width: 3em;" id="s_bg_r" type="text" maxlength="3" size="3" name="s_bg_r"
1569  onchange="prefs_update('supp');" value="255"
1570  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1571    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1572 <td><input style="width: 3em;" id="s_bg_g" type="text" maxlength="3" size="3" name="s_bg_g"
1573  onchange="prefs_update('supp');" value="255"
1574  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1575    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1576 <td><input style="width: 3em;" id="s_bg_b" type="text" maxlength="3" size="3" name="s_bg_b"
1577  onchange="prefs_update('supp');" value="255"
1578  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1579    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1580 </tr>
1581 <tr><td colspan="4" style="text-align: center;">
1582 <img id="s_img" class="nobo" src="img/noimg.png">
1583 </td></tr>
1584 </table>
1585 </div>
1586 </td>
1587 <td>
1588 <?php
1589         }
1590         else {
1591 ?>
1592 <input id="s_fg_r" type="hidden" name="s_fg_r">
1593 <input id="s_fg_g" type="hidden" name="s_fg_g">
1594 <input id="s_fg_b" type="hidden" name="s_fg_b">
1595 <input id="s_bg_r" type="hidden" name="s_bg_r">
1596 <input id="s_bg_g" type="hidden" name="s_bg_g">
1597 <input id="s_bg_b" type="hidden" name="s_bg_b">
1598 <input id="s_img"  type="hidden" name="s_bg_b">
1599 <?php
1600         }
1601 ?>
1602 </td></tr></table>
1603 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
1604 <br><br>
1605 <!-- <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]; */ ?> -->
1606 </div>
1607 </div>
1608 <div class="notify_clo">
1609 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1610 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1611 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1612 </div>
1613 </div>
1614 <script language="JavaScript">
1615 <!--
1616 cookie_law(null);
1617 // -->
1618 </script>
1619 </body>
1620 </html>
1621 <?php
1622     }
1623 }
1624 ?>