relax constraint for email verification
[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">--><img class="nobo" src="img/brisk_logo64_blackribbon.png" title="ciao grrr">
686     '.$mlang_room['headline'][$G_lang].'<br>
687     </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>',
688                                                                 ($G_with_topbanner ? $G_topbanner :
689 "<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>
690 <td align="right"><div style="padding-right: 8px;">
691 '.$banner_top_right.'</div></td>
692 </tr></table>
693 </div>';
694
695     /* MLANG: ALL THE VERTICAL MENU */
696     $brisk_vertical_menu = '
697 <!--  =========== vertical menu ===========  -->
698 <div class="topmenu">
699 <!-- <a target="_blank" href="/briskhome.php"></a> -->
700
701 <div class="webstart_hilite">
702 <img class="nobo" style="cursor: pointer;" src="img/brisk_start.png" onmouseover="menu_hide(0,0); menu_show(\'menu_webstart\');">
703 <div class="webstart" id="menu_webstart" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
704
705 <a href="#" onmouseover="menu_hide(0,1);" title="'.$mlang_room['tit_help'][$G_lang].'" onclick="act_help();"
706    >'.$mlang_room['itm_help'][$G_lang].'</a><br>
707
708 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php"
709    onmouseover="menu_hide(0,1);"
710    title="'.$mlang_room['tit_hpage'][$G_lang].'">homepage</a><br>
711
712 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#cose"
713    onmouseover="menu_hide(0,1);"
714    title="'.$mlang_room['tit_what'][$G_lang].'">'.$mlang_room['itm_what'][$G_lang].'</a><br>
715
716 <a target="_blank" href="'.$mlang_room['url_rules'][$G_lang].'"
717    onmouseover="menu_hide(0,1);"
718    title="'.$mlang_room['tit_rules'][$G_lang].'">'.$mlang_room['itm_rules'][$G_lang].'</a><br>
719
720 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#shots"
721    onmouseover="menu_hide(0,1);"
722    title="'.$mlang_room['tit_shot'][$G_lang].'">screenshoots</a><br>
723
724 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#comp"
725    onmouseover="menu_hide(0,1);"
726    title="'.$mlang_room['tit_comp'][$G_lang].'">'.$mlang_room['itm_comp'][$G_lang].'</a><br>
727
728 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#sources"
729    onmouseover="menu_hide(0,1);"
730    title="'.$mlang_room['tit_src'][$G_lang].'">'.$mlang_room['itm_src'][$G_lang].'</a><br>
731
732 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#mailing"
733    onmouseover="menu_hide(0,1);"
734    title="'.$mlang_room['tit_ml'][$G_lang].'">'.$mlang_room['itm_ml'][$G_lang].'</a><br>
735
736 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#prop"
737    onmouseover="menu_hide(0,1);"
738    title="'.$mlang_room['tit_pro'][$G_lang].'">'.$mlang_room['itm_pro'][$G_lang].'</a><br>
739 <a href="#"
740    onmouseover="menu_hide(0,1);"
741    title="credits" onclick="act_about();">about</a><br>
742
743 <a href="mailto:brisk@alternativeoutput.it"
744    onmouseover="menu_hide(0,1);"
745    title="'.$mlang_room['tit_mail'][$G_lang].'">'.$mlang_room['itm_mail'][$G_lang].'</a><br>
746
747 <a target="_blank" href="http://www.alternativeoutput.it/cookie.php"
748    onmouseover="menu_hide(0,1);"
749    title="'.$mlang_room['tit_cook'][$G_lang].'"
750    alt="'.$mlang_room['tit_cook'][$G_lang].'">'.$mlang_room['itm_cook'][$G_lang].'</a><br>
751 <hr>
752
753 <a href="#"
754    onmouseover="menu_hide(0,1);"
755    title="'.$mlang_room['tit_cla'][$G_lang].'" onclick="act_placing();">'.$mlang_room['itm_cla'][$G_lang].'</a><br>
756
757 <a target="_blank" href="briskin5/explain.php"
758    onmouseover="menu_hide(0,1);"
759    title="'.$mlang_room['tit_mnu'][$G_lang].'">'.$mlang_room['itm_mnu'][$G_lang].'</a><br>
760
761 <a href="#"
762    onmouseover="menu_hide(0,1);"
763    title="'.$mlang_room['tit_rmap'][$G_lang].'" onclick="act_roadmap();">'.$mlang_room['itm_rmap'][$G_lang].'</a><br>
764
765 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'"
766    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
767
768 <div style="text-align: right;" id="menu_meeting" class="webstart">
769 <a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
770    target="_blank" onmouseover="menu_hide(0,2);"
771    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>
772
773 <a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
774    target="_blank" onmouseover="menu_hide(0,2);"
775    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>
776
777 <a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
778    target="_blank" onmouseover="menu_hide(0,2);"
779    title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
780
781 <a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
782    target="_blank" onmouseover="menu_hide(0,2);"
783    title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
784
785 <a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
786    target="_blank" onmouseover="menu_hide(0,2);"
787    title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
788
789 <a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1"
790    target="_blank" onmouseover="menu_hide(0,2);"
791    title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
792
793 <a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1"
794    target="_blank" onmouseover="menu_hide(0,2);"
795    title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
796
797 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806"
798    target="_blank" onmouseover="menu_hide(0,2);"
799    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
800
801 <a href="http://www.anomalia.it/mop/photoo"
802    target="_blank" onmouseover="menu_hide(0,2);"
803    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
804
805 </div>
806 </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\');">
807
808 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
809
810 <a href="#" title="'
811           // MLANG
812           .$mlang_room['tit_stat'][$G_lang].
813 '"
814    onmouseover="menu_hide(0,1); menu_show(\'menu_state\');">'
815           // MLANG
816           .$mlang_room['stat_desc'][$G_lang].
817 '</a><br>
818 <div id="menu_state" class="webstart">
819 <a href="#"
820    onmouseover="menu_hide(0,2);"
821    title="" onclick="act_chatt(\'/st normale\'); menu_over(-1,this);">'
822           // MLANG
823           .$mlang_room['st_norm_desc'][$G_lang].
824 '</a><br>
825
826 <a href="#"
827    onmouseover="menu_hide(0,2);"
828    title="" onclick="act_chatt(\'/st pausa\'); menu_over(-1,this);">'
829           // MLANG
830           .$mlang_room['st_paus_desc'][$G_lang].
831 '&nbsp;<img class="unbo" src="img/st_pau.png"></a><br>
832
833 <a href="#"
834    onmouseover="menu_hide(0,2);"
835    title="" onclick="act_chatt(\'/st fuori\'); menu_over(-1,this);">'
836           // MLANG
837           .$mlang_room['st_out_desc'][$G_lang].
838 '&nbsp;<img class="unbo" src="img/st_out.png"></a><br>
839
840 <a href="#"
841    onmouseover="menu_hide(0,2);"
842    title="" onclick="act_chatt(\'/st cane\'); menu_over(-1,this);">'
843           // MLANG
844           .$mlang_room['st_dog_desc'][$G_lang].
845 '&nbsp;<img class="unbo" src="img/st_dog.png"></a><br>
846
847 <a href="#"
848    onmouseover="menu_hide(0,2);"
849    title="" onclick="act_chatt(\'/st cibo\'); menu_over(-1,this);">'
850           // MLANG
851           .$mlang_room['st_food_desc'][$G_lang].
852 '&nbsp;<img class="unbo" src="img/st_eat.png"></a><br>
853
854 <a href="#"
855    onmouseover="menu_hide(0,2);"
856    title="" onclick="act_chatt(\'/st lavoro\'); menu_over(-1,this);">'
857           // MLANG
858           .$mlang_room['st_work_desc'][$G_lang].
859 '&nbsp;<img class="unbo" src="img/st_wrk.png"></a><br>
860
861 <a href="#"
862    onmouseover="menu_hide(0,2);"
863    title="" onclick="act_chatt(\'/st sigaretta\'); menu_over(-1,this);">'
864           // MLANG
865           .$mlang_room['st_smok_desc'][$G_lang].
866 '&nbsp;<img class="unbo" src="img/st_smk.png"></a><br>
867
868 <a href="#"
869    onmouseover="menu_hide(0,2);"
870    title="" onclick="act_chatt(\'/st presente\'); menu_over(-1,this);">'
871           // MLANG
872           .$mlang_room['st_pres_desc'][$G_lang].
873 '&nbsp;<img class="unbo" src="img/st_eye.png"></a><br>
874
875 <a href="#"
876    onmouseover="menu_hide(0,2);"
877    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
878           // MLANG
879           .$mlang_room['st_rabb_desc'][$G_lang].
880 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
881
882 <a href="#"
883    onmouseover="menu_hide(0,2);"
884    title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
885           // MLANG
886           .$mlang_room['st_socc_desc'][$G_lang].
887 '&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
888
889 <a href="#"
890    onmouseover="menu_hide(0,2);"
891    title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
892           // MLANG
893           .$mlang_room['st_baby_desc'][$G_lang].
894 '&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
895
896 <a href="#"
897    onmouseover="menu_hide(0,2);"
898    title="" onclick="act_chatt(\'/st pulizie\'); menu_over(-1,this);">'
899           // MLANG
900           .$mlang_room['st_mop_desc'][$G_lang].
901 '&nbsp;<img class="unbo" src="img/st_mop.png"></a><br>
902
903 <a href="#"
904    onmouseover="menu_hide(0,2);"
905    title="" onclick="act_chatt(\'/st babbo\'); menu_over(-1,this);">'
906           // MLANG
907           .$mlang_room['st_babbo_desc'][$G_lang].
908 '&nbsp;<img class="unbo" src="img/st_babbo.png"></a><br>
909
910 <a href="#"
911    onmouseover="menu_hide(0,2);"
912    title="" onclick="act_chatt(\'/st renna\'); menu_over(-1,this);">'
913           // MLANG
914           .$mlang_room['st_renna_desc'][$G_lang].
915 '&nbsp;<img class="unbo" src="img/st_renna.png"></a><br>
916
917 <a href="#"
918    onmouseover="menu_hide(0,2);"
919    title="" onclick="act_chatt(\'/st pupazzo\'); menu_over(-1,this);">'
920           // MLANG
921           .$mlang_room['st_pupaz_desc'][$G_lang].
922 '&nbsp;<img class="unbo" src="img/st_pupaz.png"></a><br>
923
924 <a href="#"
925    onmouseover="menu_hide(0,2);"
926    title="" onclick="act_chatt(\'/st vischio\'); menu_over(-1,this);">'
927           // MLANG
928           .$mlang_room['st_visch_desc'][$G_lang].
929 '&nbsp;<img class="unbo" src="img/st_visch.png"></a><br>
930
931 </div>
932
933 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo"
934    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>
935
936 <a href="#" title="'
937           // MLANG garantisci per un tuo conoscente
938           .$mlang_room['warr_desc'][$G_lang].
939 '"
940    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/authreq\'); menu_over(-1,this);">'
941           // MLANG garantisci
942           .$mlang_room['itm_warr'][$G_lang].
943           '</a><br>
944
945
946
947 <a href="#" title="'
948           // MLANG garantisci per un tuo conoscente
949           .$mlang_room['splash_desc'][$G_lang].
950 '"
951    onmouseover="menu_hide(0,1);" onclick="act_splash(); menu_over(-1,this);">'
952           // MLANG garantisci
953           .$mlang_room['tit_splash'][$G_lang].
954           '</a><br>
955 '.($user->is_auth() ? '
956 <a href="#" title="'
957           // MLANG garantisci per un tuo conoscente
958           .$mlang_room['prefs_desc'][$G_lang].'"
959    onmouseover="menu_hide(0,1);" onclick="$(\'preferences\').style.visibility = \'visible\'; menu_over(-1,this);">'
960           // MLANG garantisci
961    .$mlang_room['tit_prefs'][$G_lang].'</a><br>' : '').'
962
963 </div>'.($G_with_poll ? '' : '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
964 <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();">').'
965 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
966 '.($user->flags & USER_FLAG_AUTH ? '
967 <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()
968  : '
969 <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();">
970 ').'
971
972 ' : '').'
973
974 </div>
975 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
976 sponsored by:<br>
977 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
978 <div id="spon_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */ ">
979 <div style="/*background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_sponsor.'<br>
980 </div></div>
981 <div style="position: absolute;">
982 '.$altout_sponsor_big.'
983 </div>
984 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
985 supported by:<br>
986 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
987 <div id="supp_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */">
988 <div style="/* background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_support.'<br>
989
990 </div>
991 </div>
992 <div style="position: absolute;">
993 '.$altout_support_big.'
994 </div>
995 <a style="/* position: absolute; top: 40px; left: 6px; */" target="_blank" href="http://it-it.facebook.com/group.php?gid=59742820791"><img class="nobo" id="btn_facebook" src="img/facebook_btn.png" title="unisciti al gruppo \'quelli della brisk\'"></a>
996 ' . ( /* NOTE: here facebook or fake facebook */
997 (!$G_is_local && $_cookie_law_3party == 'true') ?
998 '<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>
999 ' : '' ) . '<div id="proflashext" class="proflashext"><div id="proflash" class="proflash"></div></div>
1000 <img id="stm_stat" class="nobo" style="margin-top: 4px;" src="img/line-status_b.png">
1001 %s
1002 %s
1003 </div>';
1004
1005     /* Templates. */
1006     if ($ACTION == 'login') {
1007         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1008 ?>
1009 <html>
1010 <head>
1011 <title>Brisk</title>
1012 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1013 <link rel="shortcut icon" href="img/brisk_ico.png">
1014 <script type="text/javascript" src="commons.js"></script>
1015 <script type="text/javascript" src="fieldify.js"></script>
1016 <script type="text/javascript" src="prefs.js"></script>
1017 <script type="text/javascript" src="info.js"></script>
1018 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1019 <script type="text/javascript" src="menu.js"></script>
1020 <script type="text/javascript" src="heartbit.js"></script>
1021 <script type="text/javascript" src="xynt-streaming.js"></script>
1022 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1023 <script type="text/javascript" src="AC_OETags.js"></script>
1024 <script type="text/javascript" src="room.js"></script>
1025 <script type="text/javascript" src="md5.js"></script>
1026 <script type="text/javascript" src="probrowser.js"></script>
1027 <script type="text/javascript" src="json2.js"></script>
1028 <script type="text/javascript" src="/cookie_law.js"></script>
1029 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1030 <link rel="stylesheet" type="text/css" href="brisk.css">
1031 <link rel="stylesheet" type="text/css" href="room.css">
1032
1033 <script type="text/javascript"><!--
1034 var g_debug = 0;
1035 var g_lang = "<? echo $G_lang; ?>";
1036 var g_lng = "<? echo $G_lng; ?>";
1037 var g_tables_n = <? echo TABLES_N; ?>;
1038 var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1039 var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1040 var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1041 var g_prefs, g_prefs_new = null;
1042 var g_listen;
1043 var g_withflash = false;
1044 var g_is_spawn = 0;
1045 var g_nd = null;
1046 var g_brow = null;
1047 var gst  = new globst();
1048 var topbanner_sfx, topbanner_dx;
1049 var xstm = null;
1050 var sess = "not_connected";
1051 var spo_slide, sup_slide;
1052
1053 window.onload = function() {
1054     // alert(window.onbeforeunload);
1055     g_brow = get_browser_agent();
1056
1057     g_prefs = new client_prefs(null);
1058
1059     spo_slide  = new sideslide($('spon_caro'), 80, 20);
1060     sup_slide  = new sideslide($('supp_caro'), 80, 20);
1061
1062     login_init();
1063     <?php
1064         if ($G_with_topbanner) {
1065             printf("    topbanner_init();\n");
1066         }
1067     sidebanners_init($G_sidebanner_idx);
1068     ?>
1069
1070     g_withflash = DetectFlashVer(6,0,0);
1071     if (g_withflash == false) {
1072         $("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>';
1073     }
1074     else
1075         $("proflashext").innerHTML = "";
1076     $("nameid").focus();
1077 }
1078 //-->
1079 </script>
1080 </head>
1081 <?php
1082         if (!$G_is_local && $_cookie_law_3party == 'true') {
1083 ?>
1084 <!-- if myconsole <body onunload="deconsole();"> -->
1085 <body xmlns:fb="http://ogp.me/ns/fb#">
1086 <div id="fb-root"></div>
1087 <script type="text/javascript"><!--
1088 (function(d, s, id) {
1089     var js, fjs = d.getElementsByTagName(s)[0];
1090     if (d.getElementById(id)) return;
1091     js = d.createElement(s); js.id = id;
1092     js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1093     fjs.parentNode.insertBefore(js, fjs);
1094 }(document, 'script', 'facebook-jssdk'));</script>
1095 <?php
1096         }
1097         else {
1098 ?>
1099 <body>
1100 <?php
1101         }
1102         printf($brisk_header_form);
1103         printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1104         printf($brisk_vertical_menu, '', '');
1105
1106         sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1107         printf("</td><td>");
1108 ?>
1109
1110 <!--  =========== tables ===========  -->
1111 <?php
1112
1113 /* 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)" */
1114         echo "$body";
1115 ?>
1116     <br>
1117     <div style="text-align: center;">
1118     <br>
1119         <div class="bye_msg" id="bye_msg"><?php echo "$last_msg"; ?></div>
1120     <br>
1121 <?php echo $mlang_room['welcome'][$G_lang];?>
1122     <br><br>
1123     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_login_manager(this);">
1124     <input id="passid_private" name="pass_private" type="hidden" value="">
1125     <table class="login">
1126     <tr><td>nickname:</td>
1127     <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1128     <tr><td>password:</td>
1129     <td><input id="passid" class="input_text" name="pass" type="password" size="24" maxlength="64" value=""></td></tr>
1130     <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_enter'][$G_lang];?>" type="submit" class="button"></td></tr>
1131     </table>
1132     </form><br>
1133
1134     <?php echo $mlang_room['passwarn'][$G_lang];?><br><br>
1135
1136          <button onclick="$('apprentice_div').style.display = ($('apprentice_div').style.display == 'none' ? 'inline-block' : 'none');">Vuoi ottenere un accesso da apprendista ?</button><br><br>
1137              <div id="apprentice_div" style="display: none;" class="apprentice">
1138          <br>
1139          Inserisci il tuo nickname e il tuo indirizzo e-mail.<br>
1140          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>
1141     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_new_apprentice(this);">
1142     <input type="hidden" name="realsub" value="666">
1143     <table class="login">
1144     <tr><td>nickname:</td>
1145     <td><input id="nameid" class="input_text" name="cli_name" type="text" size="24" maxlength="12" value=""></td></tr>
1146     <tr><td>e-mail:</td>
1147     <td><input id="emailid" class="input_text" name="cli_email" type="text" size="24" maxlength="512" value=""></td></tr>
1148                                                                           <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>
1149         <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>
1150     </table>
1151     </form></div>
1152          <br><br>
1153 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
1154     </div>
1155
1156     <div id="imgct"></div>
1157     <div id="logz"></div>
1158     <div id="sandbox"></div>
1159     <div id="sandbox2"></div>
1160     <div id="response"></div>
1161     <div id="xhrstart"></div>
1162     <pre>
1163     <div id="xhrlog"></div>
1164     </pre>
1165     <div id="xhrdeltalog"></div>
1166
1167 <script language="JavaScript">
1168 <!--
1169 cookie_law(null);
1170 // -->
1171 </script>
1172 </body>
1173 </html>
1174 <?php
1175     }
1176     else if ($ACTION == 'room') {
1177         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1178 ?>
1179 <html>
1180 <head>
1181 <title>Brisk</title>
1182 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1183 <link rel="shortcut icon" href="img/brisk_ico.png">
1184 <script type="text/javascript" src="commons.js"></script>
1185 <script type="text/javascript" src="fieldify.js"></script>
1186 <script type="text/javascript" src="prefs.js"></script>
1187 <script type="text/javascript" src="info.js"></script>
1188 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1189 <script type="text/javascript" src="menu.js"></script>
1190 <script type="text/javascript" src="ticker.js"></script>
1191 <script type="text/javascript" src="heartbit.js"></script>
1192 <script type="text/javascript" src="xynt-streaming.js"></script>
1193 <script type="text/javascript" src="room.js"></script>
1194 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1195 <script type="text/javascript" src="AC_OETags.js"></script>
1196 <script type="text/javascript" src="probrowser.js"></script>
1197 <script type="text/javascript" src="json2.js"></script>
1198 <script type="text/javascript" src="/cookie_law.js"></script>
1199 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1200 <link rel="stylesheet" type="text/css" href="brisk.css">
1201 <link rel="stylesheet" type="text/css" href="room.css">
1202 <script type="text/javascript"><!--
1203    var sess = "not_connected";
1204    var g_debug = 0;
1205    var g_lang = "<? echo $G_lang; ?>";
1206    var g_lng = "<? echo $G_lng; ?>";
1207    var g_tables_n = <? echo TABLES_N; ?>;
1208    var g_tables_appr_n = <? echo TABLES_APPR_N; ?>;
1209    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1210    var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1211    var g_prefs, g_prefs_new = null;
1212    var g_listen;
1213    var g_is_spawn = 0;
1214    var g_withflash = false;
1215    var g_imgct = 0;
1216    var g_imgtot = g_preload_img_arr.length;
1217    var g_brow = null;
1218    var g_nd = null;
1219    var tra = null;
1220    var stat = "";
1221    var subst = "";
1222    var gst  = new globst();
1223    var topbanner_sfx, topbanner_dx;
1224    // var nonunload = false;
1225    var spo_slide, sup_slide;
1226
1227    window.onload = function() {
1228      g_brow = get_browser_agent();
1229
1230      g_prefs = new client_prefs(null);
1231
1232      spo_slide  = new sideslide($('spon_caro'), 80, 20);
1233      sup_slide  = new sideslide($('supp_caro'), 80, 20);
1234
1235 <?php
1236         if ($BRISK_SHOWHTML == "debugtable") {
1237 ?>
1238      room_checkspace(12, <?php echo TABLES_N; ?>, 50);
1239 <?php
1240         }
1241         else {
1242 ?>
1243     // alert("INDEX START");
1244      menu_init();
1245 <?php
1246         if ($G_with_topbanner) {
1247             printf("     topbanner_init();\n");
1248         }
1249         sidebanners_init($G_sidebanner_idx);
1250 ?>
1251      sess = "<?php echo "$sess"; ?>";
1252 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);});
1253      xstm.hbit_set(heartbit);
1254      tra = new train($('room_tit'));
1255      window.onunload = onunload_cb;
1256      window.onbeforeunload = onbeforeunload_cb;
1257      g_withflash = DetectFlashVer(6,0,0);
1258      if (g_withflash == false) {
1259        $("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>';
1260      }
1261      else
1262        $("proflashext").innerHTML = "";
1263
1264      // console.log("session from main: "+sess);
1265      xstm.start();
1266      // alert("ARR LENGTH "+g_preload_img_arr.length);
1267      // FIXME: preload image will be fired by stream instead here
1268      // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
1269      $("txt_in").focus();
1270 <?php
1271         if ($is_login) {
1272   /* 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" */
1273             echo show_notify($mlang_room['regwarn'][$G_lang], 0, $mlang_room['btn_rettabs'][$G_lang], 400, 150);
1274         }
1275     }
1276 ?>
1277 }
1278 //-->
1279 </script>
1280 </head>
1281 <?php
1282     if (!$G_is_local && $_cookie_law_3party == 'true') {
1283 ?>
1284 <!-- if myconsole <body onunload="deconsole();"> -->
1285 <body xmlns:fb="http://ogp.me/ns/fb#">
1286 <div id="fb-root"></div>
1287 <script>(function(d, s, id) {
1288   var js, fjs = d.getElementsByTagName(s)[0];
1289   if (d.getElementById(id)) return;
1290   js = d.createElement(s); js.id = id;
1291   js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1292   fjs.parentNode.insertBefore(js, fjs);
1293 }(document, 'script', 'facebook-jssdk'));</script>
1294 <?php
1295     }
1296     else {
1297 ?>
1298 <body>
1299 <?php
1300     }
1301     printf($brisk_header_form);
1302     printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1303     printf($brisk_vertical_menu, '', $brisk_donate);
1304
1305     sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1306
1307     printf("</td><td>");
1308 ?>
1309 <!--  =========== tables ===========  -->
1310 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
1311 <table class="macro"><tr><td>
1312 <?php echo "$tables";?>
1313 </td></tr><tr><td>
1314 <?php echo "$standup";?>
1315 </td></tr></table>
1316 </td></tr></table>
1317
1318 <!--  =========== bottom ===========  -->
1319 <div id="bottom" class="bottom">
1320 <b>Chat</b> <span id="list_info" style="color: red;"></span><br>
1321 <div id="txt" class="chatt">
1322 </div>
1323 <div style="text-align: center; ">
1324     <!-- MLANG: scrivi un invito al tavolo e clicca -->
1325     <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;">
1326     <div id="myname"></div>
1327     </td><td>
1328     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
1329     </td></tr></table>
1330 </div>
1331 </div>
1332
1333     <div id="authbox" class="notify" style="text-align: center;">
1334        <br>
1335        <b>
1336     <!-- MLANG: Garantisci per un tuo conoscente: -->
1337 <?php echo $mlang_room['tit_warr'][$G_lang];?>
1338 </b>
1339        <br><br>
1340
1341        <form id="auth_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_authbox(this);">
1342        <input type="hidden" name="realsub" value="666">
1343 <table class="login">
1344 <tr><td>nickname:</td>
1345 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1346 <tr><td>e-mail:</td>
1347 <td><input id="emailid" class="input_text" name="email" type="text" size="24" maxlength="1024" value=""></td></tr>
1348 <tr><td colspan="2" style="text-align: center;">
1349     <!-- MLANG: Garantisci per un tuo conoscente: -->
1350        <input id="subid" name="sub" value=
1351 "<?php echo $mlang_room['btn_send'][$G_lang]; ?>"
1352  type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1353     <!-- MLANG: Garantisci per un tuo conoscente: -->
1354 <input id="cloid" name="clo" value=
1355 "<?php echo $mlang_room['btn_close'][$G_lang]; ?>"
1356 type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1357 </table>
1358     </form>
1359     </div>
1360     <div id="mesgtoadmbox" class="notify_opaque" style="text-align: center;">
1361        <br>
1362 <!--MLANG: Invia un messaggio o una segnalazione all\'amministratore: -->
1363        <b><?php echo $mlang_room['mesgtoadm_tit'][$G_lang];?></b>
1364        <br><br>
1365        <form id="mesgtoadm_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_mesgtoadmbox(this);">
1366        <input type="hidden" name="realsub" value="666">
1367 <table class="login">
1368 <!--MLANG: soggetto -->
1369 <tr><td><b><?php echo $mlang_room['mesgtoadm_sub'][$G_lang];?></b></td>
1370 <td><input id="subjid" class="input_text" name="subj" type="text" size="32" maxlength="255" value=""></td></tr></table>
1371 <table class="login">
1372 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
1373 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
1374 <tr><td colspan="2" style="text-align: center;">
1375        <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;
1376 <input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="submit_click(this);"></td></tr>
1377 </table>
1378     </form>
1379     </div>
1380 <div id="heartbit"></div>
1381 <div id="sandbox"></div>
1382 <div id="imgct"></div>
1383 <div id="logz"></div>
1384 <div id="sandbox2"></div>
1385 <div id="response"></div>
1386 <div id="remark"></div>
1387 <div id="xhrstart"></div>
1388 <div id="xhrlog"></div>
1389 <div id="xhrdeltalog"></div>
1390 </div>
1391
1392 <div id="info" class="notify" style="z-index: 200; width: 500px; margin-left: -250px; height: 340px; top: 150px; visibility: hidden;">
1393 <table class="info">
1394
1395 <tr>
1396 <td class="head"><span><?php echo $mlang_room['info_login'][$G_lang]; ?>:</span></td>
1397 <td class="ri b-right data"><span class="login_id"></span></td>
1398 <td class="head"><span><?php echo $mlang_room['info_status'][$G_lang]; ?>:</span></td>
1399 <td class="ri data"><span class="state_id"></span></td>
1400 </tr>
1401
1402 <tr>
1403 <td class="head"><span><?php echo $mlang_room['info_guar'][$G_lang]; ?>:</span></td>
1404 <td class="ri b-right data"><span class="guar_id"></span></td>
1405 <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>
1406 <td class="ri data"><span class="match_id"></span></td>
1407 </tr>
1408
1409 <tr>
1410 <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>
1411 <td class="ri b-right data"><span class="party_id"></span></td>
1412 <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>
1413 <td class="ri data"><span class="game_id"></span></td>
1414 </tr>
1415
1416 <tr class="widefriend_id">
1417 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repfrie'][$G_lang]; ?>:</span></td>
1418 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td>
1419 </tr>
1420
1421 <tr class="widefriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1422 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1423 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1424 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1425
1426 <tr class="narrowfriend_id">
1427 <td colspan="3" class="head"><span><?php echo $mlang_room['info_repbff'][$G_lang]; ?>:</span></td>
1428 <td class="le data"><?php echo $mlang_room['info_skill'][$G_lang]; ?>: <span class="skill_id"></span></td></tr>
1429
1430 <tr class="narrowfriend_id"><td class="le info-opt data">Da evitare: <span class="black_id"></span></td>
1431 <td class="le info-opt data">In prova: <span class="test_id"></span></td>
1432 <td class="le info-opt data">Amico: <span class="friend_id"></span></td>
1433 <td class="le data">Fidato: <span class="bff_id"></span></td></tr>
1434 <tr><td class="le ri triple" colspan="3"><b><?php echo $mlang_room['info_frie'][$G_lang]; ?></b></td>
1435 <td class="le data triple"><input type="radio" name="friend" class="friend_id" value="black"
1436     onclick="info_onlyifknown_isvisible();">Da evitare</td></tr>
1437 <tr>
1438 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="unknown"
1439     onclick="info_onlyifknown_isvisible();">Sconosciuto</td>
1440 <td class="le info-opt data"><input type="radio" name="friend" class="friend_id" value="test"
1441     onclick="info_onlyifknown_isvisible();">In prova</td>
1442 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="friend"
1443     onclick="info_onlyifknown_isvisible();">Amico</td>
1444 <td class="ri info-opt data"><input type="radio" name="friend" class="friend_id" value="bff"
1445     onclick="info_onlyifknown_isvisible();">Amico fidato</td>
1446 </tr>
1447 <tr class="onlyifknown_gid">
1448 <td class="le head"><span><?php echo $mlang_room['info_skill'][$G_lang]; ?>:</span></td>
1449 <td class="data">
1450     <table class="fiverank" style="margin: auto;">
1451        <tr><td class="c1t">1</td>
1452            <td class="c2t">2</td>
1453            <td class="c3t">3</td>
1454            <td class="c4t">4</td>
1455            <td class="c5t">5</td></tr>
1456        <tr><td class="c1b"><input type="radio" name="skill" class="skill_id" value="1"></td>
1457            <td class="c2b"><input type="radio" name="skill" class="skill_id" value="2"></td>
1458            <td class="c3b"><input type="radio" name="skill" class="skill_id" value="3"></td>
1459            <td class="c4b"><input type="radio" name="skill" class="skill_id" value="4"></td>
1460            <td class="c5b"><input type="radio" name="skill" class="skill_id" value="5"></td>
1461        </tr>
1462     </table>
1463 </td>
1464 <td class="le"><b>Credibilità:</b></td>
1465 <td class="data">
1466     <table class="fiverank" style="margin: auto;">
1467        <tr><td class="c1t">1</td>
1468            <td class="c2t">2</td>
1469            <td class="c3t">3</td>
1470            <td class="c4t">4</td>
1471            <td class="c5t">5</td></tr>
1472        <tr><td class="c1b"><input type="radio" name="trust" class="trust_id" value="1"></td>
1473            <td class="c2b"><input type="radio" name="trust" class="trust_id" value="2"></td>
1474            <td class="c3b"><input type="radio" name="trust" class="trust_id" value="3"></td>
1475            <td class="c4b"><input type="radio" name="trust" class="trust_id" value="4"></td>
1476            <td class="c5b"><input type="radio" name="trust" class="trust_id" value="5"></td>
1477        </tr>
1478     </table>
1479 </td></tr>
1480 </table>
1481 <div style="position: absolute; bottom: 8px; margin: auto; width: 100%;">
1482 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('info').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1483 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1484 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="info_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1485 </div>
1486
1487 </div>
1488
1489 <div id="preferences" class="notify" style="z-index: 200; width: 600px; margin-left: -300px; height: 240px; top: 150px; visibility: hidden;">
1490 <div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 370px;">
1491
1492 <h2><?php echo $mlang_room['tit_prefs'][$G_lang]; ?></h2>
1493 <table style="margin: auto;"><tr><td style="vertical-align: top;">
1494 <!--#
1495     #  LISTEN
1496     #-->
1497 <div style="float: left; padding: 8px;">
1498 <table style="border: 1px solid gray;"><tr><th style="background-color: #cccccc;">
1499 <?php echo $mlang_room['itm_list'][$G_lang];?>
1500 </th></tr>
1501 <tr><td><input style="vertical-align: bottom;" id="ra_listen_all" type="radio" name="listen" value="0" onclick="prefs_update('listen');" title="'
1502 <?php echo $mlang_room['listall_desc'][$G_lang];?>
1503 '"><span id="list_all">
1504 <?php echo $mlang_room['tit_listall'][$G_lang];?>
1505 </span></td></tr>
1506 <tr><td><input style="vertical-align: bottom;" id="ra_listen_auth" type="radio" name="listen" value="1" onclick="prefs_update('listen');" title="'
1507 <?php echo $mlang_room['listaut_desc'][$G_lang];?>
1508 '"><span id="list_auth">
1509 <?php echo $mlang_room['tit_listaut'][$G_lang];?>
1510 </span></td></tr>
1511 <tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="2" onclick="prefs_update('listen');" title="'
1512 <?php echo $mlang_room['listisol_desc'][$G_lang];?>
1513 '"><span id="list_isol">
1514 <?php echo $mlang_room['tit_listisol'][$G_lang];?>
1515 </span></td></tr>
1516 </table>
1517 </div>
1518 <?php
1519     if ($user->is_supp_custom()) {
1520 ?>
1521 </td>
1522 <td style="vertical-align: top;">
1523 <!--#
1524     #  SUPPORTER ONLY
1525     #-->
1526 <div style="float: left; padding: 8px;">
1527 <table style="border: 1px solid gray;"><tr><th colspan="4" style="background-color: #cccccc;">
1528 <?php echo $mlang_room['suppcomp_tit'][$G_lang];?>
1529 </th></tr>
1530 <tr>
1531 <th>
1532 <?php echo $mlang_room['suppcomp_fg'][$G_lang];?>
1533 </th><td><input style="width: 3em;" id="s_fg_r" type="text" maxlength="3" size="3" name="s_fg_r"
1534  onchange="prefs_update('supp');" value="255"
1535  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1536    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1537 <td><input style="width: 3em;" id="s_fg_g" type="text" maxlength="3" size="3" name="s_fg_g"
1538  onchange="prefs_update('supp');" value="255"
1539  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1540    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1541 <td><input style="width: 3em;" id="s_fg_b" type="text" maxlength="3" size="3" name="s_fg_b"
1542  onchange="prefs_update('supp');" value="255"
1543  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1544    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1545 </tr>
1546 <tr>
1547 <th>
1548 <?php echo $mlang_room['suppcomp_bg'][$G_lang];?>
1549 </th>
1550 <td><input style="width: 3em;" id="s_bg_r" type="text" maxlength="3" size="3" name="s_bg_r"
1551  onchange="prefs_update('supp');" value="255"
1552  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1553    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1554 <td><input style="width: 3em;" id="s_bg_g" type="text" maxlength="3" size="3" name="s_bg_g"
1555  onchange="prefs_update('supp');" value="255"
1556  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1557    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1558 <td><input style="width: 3em;" id="s_bg_b" type="text" maxlength="3" size="3" name="s_bg_b"
1559  onchange="prefs_update('supp');" value="255"
1560  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1561    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1562 </tr>
1563 <tr><td colspan="4" style="text-align: center;">
1564 <img id="s_img" class="nobo" src="img/noimg.png">
1565 </td></tr>
1566 </table>
1567 </div>
1568 </td>
1569 <td>
1570 <?php
1571         }
1572         else {
1573 ?>
1574 <input id="s_fg_r" type="hidden" name="s_fg_r">
1575 <input id="s_fg_g" type="hidden" name="s_fg_g">
1576 <input id="s_fg_b" type="hidden" name="s_fg_b">
1577 <input id="s_bg_r" type="hidden" name="s_bg_r">
1578 <input id="s_bg_g" type="hidden" name="s_bg_g">
1579 <input id="s_bg_b" type="hidden" name="s_bg_b">
1580 <input id="s_img"  type="hidden" name="s_bg_b">
1581 <?php
1582         }
1583 ?>
1584 </td></tr></table>
1585 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
1586 <br><br>
1587 <!-- <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]; */ ?> -->
1588 </div>
1589 </div>
1590 <div class="notify_clo">
1591 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1592 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1593 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1594 </div>
1595 </div>
1596 <script language="JavaScript">
1597 <!--
1598 cookie_law(null);
1599 // -->
1600 </script>
1601 </body>
1602 </html>
1603 <?php
1604     }
1605 }
1606 ?>