a3be7498de1d60786e9c2adfaff3cd38ef2fe7da
[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                      );
232
233 require_once("briskin5/Obj/briskin5.phh");
234
235 function poll_dom()
236 {
237     GLOBAL $G_with_poll, $G_poll_title, $G_poll_entries;
238
239     if ($G_with_poll) {
240         $ret = sprintf('<div style="padding: 0px;margin: 0px; height: 8px; font-size: 1px;"></div>
241
242 <img class="nobo" src="img/brisk_poll.png" onmouseover="menu_hide(0,0); menu_show(\'menu_poll\');">
243
244 <div style="width: 300px;" class="webstart" id="menu_poll" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
245 <b>%s</b><br><br>
246 <form id="poll_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_pollbox(this);">
247 <input type="hidden" name="realsub" value="666">', $G_poll_title);
248         for ($i = 0 ; $i < count($G_poll_entries) ; $i++) {
249             $ret .= sprintf('<INPUT TYPE="radio" NAME="category" VALUE="%s">%s<hr><br>', $G_poll_entries[$i]['id'],
250                             $G_poll_entries[$i]['cont']);
251         }
252         $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>
253 </form></div>');
254         return ($ret);
255     }
256     else
257         return '';
258 }
259
260 function sidebanners_init($sidebanner_idx)
261 {
262     for ($i = 0 ; $i < count($sidebanner_idx) ; $i++) {
263         printf("     sidebanner_init(%d);\n", $i);
264     }
265 }
266
267 function sidebanners_render($sidebanner, $sidebanner_idx)
268 {
269     $sb_n = count($sidebanner_idx);
270     if ($sb_n == 0) {
271         return;
272     }
273
274     if ($sb_n == 1) {
275         printf("<br><br>");
276     }
277
278     for ($i = 0 ; $i < $sb_n ; $i++) {
279         $idx = $sidebanner_idx[$i];
280         $sb  = $sidebanner[$idx];
281         if (!array_key_exists('link', $sb)
282             || !array_key_exists('title', $sb)
283             || !array_key_exists('icon_big', $sb)) {
284             continue;
285         }
286         $sb_type = (array_key_exists('type', $sb) ? $sb['type'] : 'meeting');
287         if (array_key_exists('icon', $sb)) {
288             $sb_icon = $sb['icon'];
289         }
290         else {
291             if ($sb_type == 'meeting') {
292                 if ($sb_n < 3) {
293                     $sb_icon = 'img/brisk_meeting60.gif';
294                 }
295                 else {
296                     $sb_icon = 'img/brisk_meeting35.gif';
297                 }
298             }
299             else {
300                 // no standard icon for other type of events please add them
301                 continue;
302             }
303         }
304         $sb_dx =  (array_key_exists('dx', $sb) ? $sb['dx'] : 100);
305         $sb_dy =  (array_key_exists('dy', $sb) ? $sb['dy'] : -230);
306
307         printf('<div class="sidebanner" style="background: #ffd780; border: solid 1px #ffae00; width: 60px;" id="sidebanner%d">', $i);
308         printf('<a target="_blank" href="%s">', $sb['link']);
309         printf('<img style="position: static; border: solid 0px black;" src="%s"', $sb_icon);
310         printf('  onMouseOver="show_bigpict($(\'sidebanner%d\'), \'over\', %d, %d, \'\');"', $i, $sb_dx, $sb_dy);
311         printf('  onMouseOut="show_bigpict($(\'sidebanner%d\'), \'out\', 0, 0, \'\');"', $i);
312         $tit = eschtml($sb['title']);
313         printf('  alt="%s" title="%s"></a></div>', $tit, $tit);
314         printf("\n");
315
316         $ib_class =  "";
317         if (array_key_exists('icon_big_class', $sb)) {
318             $ib_class = $sb['icon_big_class'];
319         }
320
321         printf('<img class="nobohide bordergray %s" style="z-index: 255;" id="sidebanner%d_big" src="%s">', $ib_class, $i, $sb['icon_big']);
322         printf("\n");
323     }
324 }
325
326 function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_full, $get, $post, $cookie)
327 {
328     GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all;
329     GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local;
330     GLOBAL $G_sidebanner, $G_sidebanner_idx;
331     GLOBAL $G_with_poll;
332     GLOBAL $G_lang, $G_lng, $mlang_room;
333     GLOBAL $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER, $_COOKIE;
334
335     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE)
336         $sess = "";
337     if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
338         unset($name);
339     else
340         log_step("LOGIN: $name");
341
342     if (($pass_private = gpcs_var('pass_private', $get, $post, $cookie)) === FALSE)
343         unset ($pass_private);
344     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
345         unset ($table_idx);
346     if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
347         unset ($table_token);
348
349     // default values
350     $_cookie_law_3party = 'true';
351     if (isset($cookie['_cookie_law_3party']))
352         $_cookie_law_3party = $cookie['_cookie_law_3party'];
353
354     $remote_addr = addrtoipv4($remote_addr_full);
355
356     $is_login = FALSE;
357     $body = "";
358     $tables = "";
359     $standup = "";
360     $ACTION = "login";
361     $last_msg = "";
362     $banned = FALSE;
363
364     if (isset($BRISK_SHOWHTML) == FALSE) {
365         $is_table = FALSE;
366         log_main("lock Brisk");
367         $curtime = time();
368
369         /* Actions */
370         if (($ghost_sess = $brisk->ghost_sess->pop($sess)) != FALSE) {
371             switch ($ghost_sess->reas) {
372             case GHOST_SESS_REAS_LOUT:
373                 $last_msg = $mlang_room['reas_lout'][$G_lang];
374                 break;
375             case GHOST_SESS_REAS_ANOT:
376                 $last_msg = $mlang_room['reas_anot'][$G_lang];
377                 break;
378             case GHOST_SESS_REAS_TOUT:
379                 $last_msg = $mlang_room['reas_tout'][$G_lang];
380                 break;
381             case GHOST_SESS_REAS_TTOT:
382                 $last_msg = $mlang_room['reas_ttot'][$G_lang];
383                 break;
384             case GHOST_SESS_REAS_ANON:
385                 $last_msg = $mlang_room['reas_anon'][$G_lang];
386                 break;
387             case GHOST_SESS_REAS_PROX:
388                 $last_msg = $mlang_room['reas_prox'][$G_lang];
389                 break;
390             default:
391                 $last_msg = $mlang_room['reas_unkn'][$G_lang];
392                 break;
393             }
394         }
395         if ($brisk->cloud_check($remote_addr)) {
396             // TODO: find a way to add a nonblocking sleep(5) here
397             $banned = TRUE;
398             $last_msg = $mlang_room['reas_cloud'][$G_lang];
399         }
400
401
402         if (validate_sess($sess)) {
403             log_main("pre garbage_manager UNO");
404             $brisk->garbage_manager(TRUE);
405             log_main("post garbage_manager");
406             if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) {
407                 if ($user->the_end == FALSE) {
408                     $brisk->sess_cur_set($user->sess);
409                     log_main("user stat: ".$user->stat);
410                     if ($user->stat == "table") {
411                         $cookies = new Cookies();
412                         $cookies->add("table_token", $user->table_token, $curtime + 31536000);
413                         $cookies->add("table_idx", $user->table, $curtime + 31536000);
414                         $header_out['cookies'] = $cookies;
415                         $header_out['Location'] = "briskin5/index.php";
416                         return TRUE;
417                     }
418                     $ACTION = "room";
419                 }
420             }
421         }
422         if (!$banned && $ACTION == "login" && isset($name)) {
423             log_main("pre garbage_manager DUE");
424
425             if (isset($pass_private) == FALSE || $pass_private == "") {
426                 $pass_private = FALSE;
427
428                 if ($brisk->ban_check($remote_addr)) {
429                     // TODO: find a way to add a nonblocking sleep(5) here
430                     $banned = TRUE;
431                     $idx = -4;
432                 }
433             }
434
435             $brisk->garbage_manager(TRUE);
436             /* try login */
437
438             if ($banned == FALSE &&
439                 ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private,
440                                           $remote_addr, $header, $cookie)) != FALSE) {
441                 $brisk->sess_cur_set($user->sess);
442                 $ACTION = "room";
443                 if ($idx < 0) {
444                     $idx = -$idx - 1;
445                     $is_login = TRUE;
446                 }
447
448                 log_legal($curtime, $remote_addr, $user, "STAT:LOGIN", '');
449
450                 // recovery lost game
451                 if ($user->stat == "table") {
452                     $cookies = new Cookies();
453                     $cookies->add("table_token", $user->table_token, $curtime + 31536000);
454                     $cookies->add("table_idx", $user->table, $curtime + 31536000);
455                     $header_out['cookies'] = $cookies;
456                     $header_out['Location'] = "briskin5/index.php";
457                     return TRUE;
458                 }
459             }
460             else {
461                 fprintf(STDERR, "POST CHECK QUI\n");
462                 /* Login Rendering */
463                 switch($idx) {
464                 case -4:
465                     $sfx = 'ban';
466                     break;
467                 case -3:
468                     $sfx = 'err';
469                     break;
470                 case -2:
471                     $sfx = 'must';
472                     break;
473                 case -1:
474                     $sfx = 'end';
475                     break;
476                 default:
477                     $sfx = 'use';
478                 }
479
480                 $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
481             }
482         }
483     }
484     /* Rendering. */
485
486     if ($BRISK_SHOWHTML == "debugtable") {
487         $ACTION = "room";
488     }
489     else if ($BRISK_SHOWHTML == "debuglogin") {
490         $ACTION = "login";
491     }
492
493     if ($ACTION == "room") {
494         $tables .= '<div class="room_tab">';
495         $tables .= '<table class="room_tab">';
496         for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
497             if ($user->is_auth())
498                 $i = $ii;
499             else
500                 $i = TABLES_N - $ii - 1;
501
502             if ($ii % 4 == 0) {
503                 $tables .= '<tr id = "tr_noauth'.$ii.'">';
504             }
505             if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $ii < TABLES_AUTH_N) {
506                 $tables .= '<td id = "td_noauth'.$ii.'">';
507
508                 $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
509                 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
510                 $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
511                 $tables .= '</div>';
512                 $tables .= '</td>'."\n";
513             }
514             if ($ii % 4 == 3) {
515                 $tables .= '</tr>';
516             }
517         }
518         $tables .= '</table></div>';
519
520         $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
521         $standup .= '<div class="room_ex_standup">';
522         /* MLANG: "Giocatori in piedi" */
523         // $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>';
524         $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
525
526         $standup .= sprintf('<div id="standup" class="room_standup"></div>');
527         // MLANG Esco.
528         $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>';
529         $standup .= '</div></td></tr></table>';
530     }
531
532     $altout_sponsor_arr = array( array ( 'id' => 'btn_altout',
533                                          'url' => 'http://www.alternativeoutput.it',
534                                          'content' => 'img/altout80x15.png',
535                                          'content_big' => 'img/logotxt_banner.png'),
536                                  array ( 'id' => 'btn_virtualsky',
537                                          'url' => 'http://virtualsky.alternativeoutput.it',
538                                          'content' => 'img/virtualsky80x15a.gif',
539                                          'content_big' => 'img/virtualsky_big.png'),
540                                  array ( 'id' => 'btn_dynamica',
541                                          'url' => 'http://www.dynamica.it',
542                                          'content' => 'img/dynamica.png',
543                                          'content_big' => 'img/dynamica_big.png')
544                                  );
545
546     $altout_support_arr = array( array ( 'id' => 'btn_brichi',
547                                          'url' => 'http://www.briscolachiamata.it',
548                                          'content' => 'img/brichi.png',
549                                          'content_big' => 'img/brichi_big.png'),
550                                  array ( 'id' => 'btn_foroli',
551                                          'url' => 'http://www.forumolimpia.it',
552                                          'content' => 'img/forumolimpia.gif',
553                                          'content_big' => 'img/forumolimpia_big.png' ),
554                                  array ( 'id'=> 'btn_niini',
555                                          'url' => 'http://www.niinivirta.it',
556                                          'content' => 'img/niinivirta.png',
557                                          'content_big' => 'img/niinivirta_big.png') );
558
559
560
561     $altout_support = "";
562     $altout_support_big = "";
563     for ($i = 0 ; $i < 4 ; $i++) {
564         $ii = ($i < 3 ? $i : 0);
565
566         $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",
567                                    $i * 20, $altout_support_arr[$ii]['url'],
568                                    $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
569
570         $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
571                                        $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
572     }
573
574
575     // seed with microseconds since last "whole" second
576     // srand ((double) microtime() * 1000000);
577     // $randval = rand(0,count($altout_sponsor_arr)-1);
578     $altout_sponsor = "";
579     $altout_sponsor_big = "";
580     for ($i = 0 ; $i < 4 ; $i++) {
581         $ii = ($i < 3 ? $i : 0);
582
583         $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",
584                                    $i * 20, $altout_sponsor_arr[$ii]['url'],
585                                    $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
586
587         $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
588                                        $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']);
589     }
590
591
592
593     /* NOTE: Brisk donate or donate fake if local */
594     if (!$G_is_local)
595         $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
596     else
597         $brisk_donate = '<div style="background-color: #ff0; height: 27px; margin-top: 4px;">BRISK_DONATE</div>';
598
599     if ($brisk_donate == FALSE)
600         $brisk_donate = "";
601
602
603     /* MLANG: "briscola chiamata in salsa ajax", */
604
605     mt_srand(make_seed());
606     if (!$G_is_local && $_cookie_law_3party == 'true') {
607         $rn = rand(0, 1);
608
609         if ($rn == 0) {
610             $banner_top_left = '<script type="text/javascript"><!--
611 google_ad_client = "pub-5246925322544303";
612 google_ad_width = 234;
613 google_ad_height = 60;
614 google_ad_format = "234x60_as";
615 google_ad_type = "text_image";
616 google_ad_channel = "";
617 google_color_border = "808080";
618 google_color_bg = "f6f6f6";
619 google_color_link = "ffae00";
620 google_color_text = "404040";
621 google_color_url = "000000";
622 //-->
623 </script>
624 <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
625             $banner_top_right = carousel_top();
626         }
627         else {
628             $banner_top_left = carousel_top();
629             $banner_top_right = '<script type="text/javascript"><!--
630 google_ad_client = "pub-5246925322544303";
631 google_ad_width = 234;
632 google_ad_height = 60;
633 google_ad_format = "234x60_as";
634 google_ad_type = "text_image";
635 google_ad_channel = "";
636 google_color_border = "808080";
637 google_color_bg = "f6f6f6";
638 google_color_link = "ffae00";
639 google_color_text = "404040";
640 google_color_url = "000000";
641 //-->
642 </script>
643 <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
644         }
645     }
646     else { // !$G_is_local
647         $banner_top_left  = carousel_top();
648         $banner_top_right = carousel_top();
649     }
650
651     $brisk_header_form = '<div class="container">
652 <!-- =========== header ===========  -->
653 <div id="header" class="header">
654 <table width="100%%" border="0" cols="3"><tr>
655 <td align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
656 <td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
657     <img class="nobo" src="img/brisk_logo64.png">
658     '.$mlang_room['headline'][$G_lang].'<br>
659     </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>',
660                                                                 ($G_with_topbanner ? $G_topbanner :
661 "<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>
662 <td align="right"><div style="padding-right: 8px;">
663 '.$banner_top_right.'</div></td>
664 </tr></table>
665 </div>';
666
667     /* MLANG: ALL THE VERTICAL MENU */
668     $brisk_vertical_menu = '
669 <!--  =========== vertical menu ===========  -->
670 <div class="topmenu">
671 <!-- <a target="_blank" href="/briskhome.php"></a> -->
672
673 <div class="webstart_hilite">
674 <img class="nobo" style="cursor: pointer;" src="img/brisk_start.png" onmouseover="menu_hide(0,0); menu_show(\'menu_webstart\');">
675 <div class="webstart" id="menu_webstart" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
676
677 <a href="#" onmouseover="menu_hide(0,1);" title="'.$mlang_room['tit_help'][$G_lang].'" onclick="act_help();"
678    >'.$mlang_room['itm_help'][$G_lang].'</a><br>
679
680 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php"
681    onmouseover="menu_hide(0,1);"
682    title="'.$mlang_room['tit_hpage'][$G_lang].'">homepage</a><br>
683
684 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#cose"
685    onmouseover="menu_hide(0,1);"
686    title="'.$mlang_room['tit_what'][$G_lang].'">'.$mlang_room['itm_what'][$G_lang].'</a><br>
687
688 <a target="_blank" href="'.$mlang_room['url_rules'][$G_lang].'"
689    onmouseover="menu_hide(0,1);"
690    title="'.$mlang_room['tit_rules'][$G_lang].'">'.$mlang_room['itm_rules'][$G_lang].'</a><br>
691
692 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#shots"
693    onmouseover="menu_hide(0,1);"
694    title="'.$mlang_room['tit_shot'][$G_lang].'">screenshoots</a><br>
695
696 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#comp"
697    onmouseover="menu_hide(0,1);"
698    title="'.$mlang_room['tit_comp'][$G_lang].'">'.$mlang_room['itm_comp'][$G_lang].'</a><br>
699
700 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#sources"
701    onmouseover="menu_hide(0,1);"
702    title="'.$mlang_room['tit_src'][$G_lang].'">'.$mlang_room['itm_src'][$G_lang].'</a><br>
703
704 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#mailing"
705    onmouseover="menu_hide(0,1);"
706    title="'.$mlang_room['tit_ml'][$G_lang].'">'.$mlang_room['itm_ml'][$G_lang].'</a><br>
707
708 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#prop"
709    onmouseover="menu_hide(0,1);"
710    title="'.$mlang_room['tit_pro'][$G_lang].'">'.$mlang_room['itm_pro'][$G_lang].'</a><br>
711 <a href="#"
712    onmouseover="menu_hide(0,1);"
713    title="credits" onclick="act_about();">about</a><br>
714
715 <a href="mailto:brisk@alternativeoutput.it"
716    onmouseover="menu_hide(0,1);"
717    title="'.$mlang_room['tit_mail'][$G_lang].'">'.$mlang_room['itm_mail'][$G_lang].'</a><br>
718
719 <a target="_blank" href="http://www.alternativeoutput.it/cookie.php"
720    onmouseover="menu_hide(0,1);"
721    title="'.$mlang_room['tit_cook'][$G_lang].'"
722    alt="'.$mlang_room['tit_cook'][$G_lang].'">'.$mlang_room['itm_cook'][$G_lang].'</a><br>
723 <hr>
724
725 <!--
726 <a href="#"
727    onmouseover="menu_hide(0,1);"
728    title="perché supportare brisk?" onclick="act_whysupport();">supportare?</a><br>
729 -->
730 <a href="#"
731    onmouseover="menu_hide(0,1);"
732    title="'.$mlang_room['tit_cla'][$G_lang].'" onclick="act_placing();">'.$mlang_room['itm_cla'][$G_lang].'</a><br>
733
734 <a target="_blank" href="briskin5/explain.php"
735    onmouseover="menu_hide(0,1);"
736    title="'.$mlang_room['tit_mnu'][$G_lang].'">'.$mlang_room['itm_mnu'][$G_lang].'</a><br>
737
738 <a href="#"
739    onmouseover="menu_hide(0,1);"
740    title="'.$mlang_room['tit_rmap'][$G_lang].'" onclick="act_roadmap();">'.$mlang_room['itm_rmap'][$G_lang].'</a><br>
741
742 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'"
743    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
744
745 <div style="text-align: right;" id="menu_meeting" class="webstart">
746 <a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
747    target="_blank" onmouseover="menu_hide(0,2);"
748    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>
749
750 <a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
751    target="_blank" onmouseover="menu_hide(0,2);"
752    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>
753
754 <a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
755    target="_blank" onmouseover="menu_hide(0,2);"
756    title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
757
758 <a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
759    target="_blank" onmouseover="menu_hide(0,2);"
760    title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
761
762 <a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
763    target="_blank" onmouseover="menu_hide(0,2);"
764    title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
765
766 <a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1"
767    target="_blank" onmouseover="menu_hide(0,2);"
768    title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
769
770 <a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1"
771    target="_blank" onmouseover="menu_hide(0,2);"
772    title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
773
774 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806"
775    target="_blank" onmouseover="menu_hide(0,2);"
776    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
777
778 <a href="http://www.anomalia.it/mop/photoo"
779    target="_blank" onmouseover="menu_hide(0,2);"
780    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
781
782 </div>
783 </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\');">
784
785 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
786
787 <a href="#" title="'
788           // MLANG
789           .$mlang_room['tit_stat'][$G_lang].
790 '"
791    onmouseover="menu_hide(0,1); menu_show(\'menu_state\');">'
792           // MLANG
793           .$mlang_room['stat_desc'][$G_lang].
794 '</a><br>
795 <div id="menu_state" class="webstart">
796 <a href="#"
797    onmouseover="menu_hide(0,2);"
798    title="" onclick="act_chatt(\'/st normale\'); menu_over(-1,this);">'
799           // MLANG
800           .$mlang_room['st_norm_desc'][$G_lang].
801 '</a><br>
802
803 <a href="#"
804    onmouseover="menu_hide(0,2);"
805    title="" onclick="act_chatt(\'/st pausa\'); menu_over(-1,this);">'
806           // MLANG
807           .$mlang_room['st_paus_desc'][$G_lang].
808 '&nbsp;<img class="unbo" src="img/st_pau.png"></a><br>
809
810 <a href="#"
811    onmouseover="menu_hide(0,2);"
812    title="" onclick="act_chatt(\'/st fuori\'); menu_over(-1,this);">'
813           // MLANG
814           .$mlang_room['st_out_desc'][$G_lang].
815 '&nbsp;<img class="unbo" src="img/st_out.png"></a><br>
816
817 <a href="#"
818    onmouseover="menu_hide(0,2);"
819    title="" onclick="act_chatt(\'/st cane\'); menu_over(-1,this);">'
820           // MLANG
821           .$mlang_room['st_dog_desc'][$G_lang].
822 '&nbsp;<img class="unbo" src="img/st_dog.png"></a><br>
823
824 <a href="#"
825    onmouseover="menu_hide(0,2);"
826    title="" onclick="act_chatt(\'/st cibo\'); menu_over(-1,this);">'
827           // MLANG
828           .$mlang_room['st_food_desc'][$G_lang].
829 '&nbsp;<img class="unbo" src="img/st_eat.png"></a><br>
830
831 <a href="#"
832    onmouseover="menu_hide(0,2);"
833    title="" onclick="act_chatt(\'/st lavoro\'); menu_over(-1,this);">'
834           // MLANG
835           .$mlang_room['st_work_desc'][$G_lang].
836 '&nbsp;<img class="unbo" src="img/st_wrk.png"></a><br>
837
838 <a href="#"
839    onmouseover="menu_hide(0,2);"
840    title="" onclick="act_chatt(\'/st sigaretta\'); menu_over(-1,this);">'
841           // MLANG
842           .$mlang_room['st_smok_desc'][$G_lang].
843 '&nbsp;<img class="unbo" src="img/st_smk.png"></a><br>
844
845 <a href="#"
846    onmouseover="menu_hide(0,2);"
847    title="" onclick="act_chatt(\'/st presente\'); menu_over(-1,this);">'
848           // MLANG
849           .$mlang_room['st_pres_desc'][$G_lang].
850 '&nbsp;<img class="unbo" src="img/st_eye.png"></a><br>
851
852 <a href="#"
853    onmouseover="menu_hide(0,2);"
854    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
855           // MLANG
856           .$mlang_room['st_rabb_desc'][$G_lang].
857 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
858
859 <a href="#"
860    onmouseover="menu_hide(0,2);"
861    title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
862           // MLANG
863           .$mlang_room['st_socc_desc'][$G_lang].
864 '&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
865
866 <a href="#"
867    onmouseover="menu_hide(0,2);"
868    title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
869           // MLANG
870           .$mlang_room['st_baby_desc'][$G_lang].
871 '&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
872
873 <a href="#"
874    onmouseover="menu_hide(0,2);"
875    title="" onclick="act_chatt(\'/st pulizie\'); menu_over(-1,this);">'
876           // MLANG
877           .$mlang_room['st_mop_desc'][$G_lang].
878 '&nbsp;<img class="unbo" src="img/st_mop.png"></a><br>
879
880 <a href="#"
881    onmouseover="menu_hide(0,2);"
882    title="" onclick="act_chatt(\'/st babbo\'); menu_over(-1,this);">'
883           // MLANG
884           .$mlang_room['st_babbo_desc'][$G_lang].
885 '&nbsp;<img class="unbo" src="img/st_babbo.png"></a><br>
886
887 <a href="#"
888    onmouseover="menu_hide(0,2);"
889    title="" onclick="act_chatt(\'/st renna\'); menu_over(-1,this);">'
890           // MLANG
891           .$mlang_room['st_renna_desc'][$G_lang].
892 '&nbsp;<img class="unbo" src="img/st_renna.png"></a><br>
893
894 <a href="#"
895    onmouseover="menu_hide(0,2);"
896    title="" onclick="act_chatt(\'/st pupazzo\'); menu_over(-1,this);">'
897           // MLANG
898           .$mlang_room['st_pupaz_desc'][$G_lang].
899 '&nbsp;<img class="unbo" src="img/st_pupaz.png"></a><br>
900
901 <a href="#"
902    onmouseover="menu_hide(0,2);"
903    title="" onclick="act_chatt(\'/st vischio\'); menu_over(-1,this);">'
904           // MLANG
905           .$mlang_room['st_visch_desc'][$G_lang].
906 '&nbsp;<img class="unbo" src="img/st_visch.png"></a><br>
907
908 </div>
909
910 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo"
911    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>
912
913 <a href="#" title="'
914           // MLANG garantisci per un tuo conoscente
915           .$mlang_room['warr_desc'][$G_lang].
916 '"
917    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/authreq\'); menu_over(-1,this);">'
918           // MLANG garantisci
919           .$mlang_room['itm_warr'][$G_lang].
920           '</a><br>
921
922
923
924 <a href="#" title="'
925           // MLANG garantisci per un tuo conoscente
926           .$mlang_room['splash_desc'][$G_lang].
927 '"
928    onmouseover="menu_hide(0,1);" onclick="act_splash(); menu_over(-1,this);">'
929           // MLANG garantisci
930           .$mlang_room['tit_splash'][$G_lang].
931           '</a><br>
932 '.($user->is_auth() ? '
933 <a href="#" title="'
934           // MLANG garantisci per un tuo conoscente
935           .$mlang_room['prefs_desc'][$G_lang].'"
936    onmouseover="menu_hide(0,1);" onclick="$(\'preferences\').style.visibility = \'visible\'; menu_over(-1,this);">'
937           // MLANG garantisci
938    .$mlang_room['tit_prefs'][$G_lang].'</a><br>' : '').'
939
940 </div>'.($G_with_poll ? '' : '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
941 <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();">').'
942 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
943 '.($user->flags & USER_FLAG_AUTH ? '
944 <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()
945  : '
946 <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();">
947 ').'
948
949 ' : '').'
950
951 </div>
952 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
953 sponsored by:<br>
954 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
955 <div id="spon_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */ ">
956 <div style="/*background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_sponsor.'<br>
957 </div></div>
958 <div style="position: absolute;">
959 '.$altout_sponsor_big.'
960 </div>
961 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
962 supported by:<br>
963 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
964 <div id="supp_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */">
965 <div style="/* background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_support.'<br>
966
967 </div>
968 </div>
969 <div style="position: absolute;">
970 '.$altout_support_big.'
971 </div>
972 <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>
973 ' . ( /* NOTE: here facebook or fake facebook */
974 (!$G_is_local && $_cookie_law_3party == 'true') ?
975 '<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>
976 ' : '' ) . '<div id="proflashext" class="proflashext"><div id="proflash" class="proflash"></div></div>
977 <img id="stm_stat" class="nobo" style="margin-top: 4px;" src="img/line-status_b.png">
978 %s
979 %s
980 </div>';
981
982     /* Templates. */
983     if ($ACTION == 'login') {
984         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
985 ?>
986 <html>
987 <head>
988 <title>Brisk</title>
989 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
990 <link rel="shortcut icon" href="img/brisk_ico.png">
991 <script type="text/javascript" src="commons.js"></script>
992 <script type="text/javascript" src="prefs.js"></script>
993 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
994 <script type="text/javascript" src="menu.js"></script>
995 <script type="text/javascript" src="heartbit.js"></script>
996 <script type="text/javascript" src="xynt-streaming.js"></script>
997 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
998 <script type="text/javascript" src="AC_OETags.js"></script>
999 <script type="text/javascript" src="room.js"></script>
1000 <script type="text/javascript" src="md5.js"></script>
1001 <script type="text/javascript" src="probrowser.js"></script>
1002 <script type="text/javascript" src="json2.js"></script>
1003 <script type="text/javascript" src="/cookie_law.js"></script>
1004 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1005 <link rel="stylesheet" type="text/css" href="brisk.css">
1006 <link rel="stylesheet" type="text/css" href="room.css">
1007
1008 <script type="text/javascript"><!--
1009 var g_debug = 0;
1010 var g_lang = "<? echo $G_lang; ?>";
1011 var g_lng = "<? echo $G_lng; ?>";
1012 var g_tables_n = <? echo TABLES_N; ?>;
1013 var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1014 var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1015 var g_prefs, g_prefs_new = null;
1016 var g_listen;
1017 var g_withflash = false;
1018 var g_is_spawn = 0;
1019 var g_nd = null;
1020 var g_brow = null;
1021 var gst  = new globst();
1022 var topbanner_sfx, topbanner_dx;
1023 var xstm = null;
1024 var sess = "not_connected";
1025 var spo_slide, sup_slide;
1026
1027 window.onload = function() {
1028     // alert(window.onbeforeunload);
1029     g_brow = get_browser_agent();
1030
1031     g_prefs = new client_prefs(null);
1032
1033     spo_slide  = new sideslide($('spon_caro'), 80, 20);
1034     sup_slide  = new sideslide($('supp_caro'), 80, 20);
1035
1036     login_init();
1037     <?php
1038         if ($G_with_topbanner) {
1039             printf("    topbanner_init();\n");
1040         }
1041     sidebanners_init($G_sidebanner_idx);
1042     ?>
1043
1044     g_withflash = DetectFlashVer(6,0,0);
1045     if (g_withflash == false) {
1046         $("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>';
1047     }
1048     else
1049         $("proflashext").innerHTML = "";
1050     $("nameid").focus();
1051 }
1052 //-->
1053 </script>
1054 </head>
1055 <?php
1056         if (!$G_is_local && $_cookie_law_3party == 'true') {
1057 ?>
1058 <!-- if myconsole <body onunload="deconsole();"> -->
1059 <body xmlns:fb="http://ogp.me/ns/fb#">
1060 <div id="fb-root"></div>
1061 <script type="text/javascript"><!--
1062 (function(d, s, id) {
1063     var js, fjs = d.getElementsByTagName(s)[0];
1064     if (d.getElementById(id)) return;
1065     js = d.createElement(s); js.id = id;
1066     js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1067     fjs.parentNode.insertBefore(js, fjs);
1068 }(document, 'script', 'facebook-jssdk'));</script>
1069 <?php
1070         }
1071         else {
1072 ?>
1073 <body>
1074 <?php
1075         }
1076         printf($brisk_header_form);
1077         printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1078         printf($brisk_vertical_menu, '', '');
1079
1080         sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1081         printf("</td><td>");
1082 ?>
1083
1084 <!--  =========== tables ===========  -->
1085 <?php
1086
1087 /* 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)" */
1088         echo "$body";
1089 ?>
1090     <br>
1091     <div style="text-align: center;">
1092     <br>
1093         <div class="bye_msg" id="bye_msg"><?php echo "$last_msg"; ?></div>
1094     <br>
1095 <?php echo $mlang_room['welcome'][$G_lang];?>
1096     <br><br>
1097     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_login_manager(this);">
1098     <input id="passid_private" name="pass_private" type="hidden" value="">
1099     <table class="login">
1100     <tr><td>nickname:</td>
1101     <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1102     <tr><td>password:</td>
1103     <td><input id="passid" class="input_text" name="pass" type="password" size="24" maxlength="64" value=""></td></tr>
1104     <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_enter'][$G_lang];?>" type="submit" class="button"></td></tr>
1105     </table>
1106     </form><br>
1107
1108     <?php echo $mlang_room['passwarn'][$G_lang];?><br><br>
1109
1110          <button onclick="$('apprentice_div').style.display = ($('apprentice_div').style.display == 'none' ? 'inline-block' : 'none');">Vuoi ottenere un accesso da apprendista ?</button><br><br>
1111              <div id="apprentice_div" style="display: none; background-color: #ffd780; border: 1px solid #ffae00; padding: 8px;">
1112          <br>
1113          Inserisci il tuo nickname e il tuo indirizzo e-mail.<br>
1114          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>
1115     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_new_apprentice(this);">
1116     <input type="hidden" name="realsub" value="666">
1117     <table class="login">
1118     <tr><td>nickname:</td>
1119     <td><input id="nameid" class="input_text" name="cli_name" type="text" size="24" maxlength="12" value=""></td></tr>
1120     <tr><td>e-mail:</td>
1121     <td><input id="emailid" class="input_text" name="cli_email" type="text" size="24" maxlength="512" value=""></td></tr>
1122                                                                           <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>
1123         <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>
1124     </table>
1125     </form></div>
1126          <br><br>
1127 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
1128     </div>
1129
1130     <div id="imgct"></div>
1131     <div id="logz"></div>
1132     <div id="sandbox"></div>
1133     <div id="sandbox2"></div>
1134     <div id="response"></div>
1135     <div id="xhrstart"></div>
1136     <pre>
1137     <div id="xhrlog"></div>
1138     </pre>
1139     <div id="xhrdeltalog"></div>
1140
1141 <script language="JavaScript">
1142 <!--
1143 cookie_law(null);
1144 // -->
1145 </script>
1146 </body>
1147 </html>
1148 <?php
1149     }
1150     else if ($ACTION == 'room') {
1151         $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
1152 ?>
1153 <html>
1154 <head>
1155 <title>Brisk</title>
1156 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1157 <link rel="shortcut icon" href="img/brisk_ico.png">
1158 <script type="text/javascript" src="commons.js"></script>
1159 <script type="text/javascript" src="prefs.js"></script>
1160 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1161 <script type="text/javascript" src="menu.js"></script>
1162 <script type="text/javascript" src="ticker.js"></script>
1163 <script type="text/javascript" src="heartbit.js"></script>
1164 <script type="text/javascript" src="xynt-streaming.js"></script>
1165 <script type="text/javascript" src="room.js"></script>
1166 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1167 <script type="text/javascript" src="AC_OETags.js"></script>
1168 <script type="text/javascript" src="probrowser.js"></script>
1169 <script type="text/javascript" src="json2.js"></script>
1170 <script type="text/javascript" src="/cookie_law.js"></script>
1171 <link rel="stylesheet" type="text/css" href="/cookie_law.css">
1172 <link rel="stylesheet" type="text/css" href="brisk.css">
1173 <link rel="stylesheet" type="text/css" href="room.css">
1174 <script type="text/javascript"><!--
1175    var sess = "not_connected";
1176    var g_debug = 0;
1177    var g_lang = "<? echo $G_lang; ?>";
1178    var g_lng = "<? echo $G_lng; ?>";
1179    var g_tables_n = <? echo TABLES_N; ?>;
1180    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1181    var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
1182    var g_prefs, g_prefs_new = null;
1183    var g_listen;
1184    var g_is_spawn = 0;
1185    var g_withflash = false;
1186    var g_imgct = 0;
1187    var g_imgtot = g_preload_img_arr.length;
1188    var g_brow = null;
1189    var g_nd = null;
1190    var tra = null;
1191    var stat = "";
1192    var subst = "";
1193    var gst  = new globst();
1194    var topbanner_sfx, topbanner_dx;
1195    // var nonunload = false;
1196    var spo_slide, sup_slide;
1197
1198    window.onload = function() {
1199      g_brow = get_browser_agent();
1200
1201      g_prefs = new client_prefs(null);
1202
1203      spo_slide  = new sideslide($('spon_caro'), 80, 20);
1204      sup_slide  = new sideslide($('supp_caro'), 80, 20);
1205
1206 <?php
1207         if ($BRISK_SHOWHTML == "debugtable") {
1208 ?>
1209      room_checkspace(12, <?php echo TABLES_N; ?>, 50);
1210 <?php
1211         }
1212         else {
1213 ?>
1214     // alert("INDEX START");
1215      menu_init();
1216 <?php
1217         if ($G_with_topbanner) {
1218             printf("     topbanner_init();\n");
1219         }
1220         sidebanners_init($G_sidebanner_idx);
1221 ?>
1222      sess = "<?php echo "$sess"; ?>";
1223 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);});
1224      xstm.hbit_set(heartbit);
1225      tra = new train($('room_tit'));
1226      window.onunload = onunload_cb;
1227      window.onbeforeunload = onbeforeunload_cb;
1228      g_withflash = DetectFlashVer(6,0,0);
1229      if (g_withflash == false) {
1230        $("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>';
1231      }
1232      else
1233        $("proflashext").innerHTML = "";
1234
1235      // console.log("session from main: "+sess);
1236      xstm.start();
1237      // alert("ARR LENGTH "+g_preload_img_arr.length);
1238      // FIXME: preload image will be fired by stream instead here
1239      // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
1240      $("txt_in").focus();
1241 <?php
1242         if ($is_login) {
1243   /* 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" */
1244             echo show_notify($mlang_room['regwarn'][$G_lang], 0, $mlang_room['btn_rettabs'][$G_lang], 400, 150);
1245         }
1246     }
1247 ?>
1248 }
1249 //-->
1250 </script>
1251 </head>
1252 <?php
1253     if (!$G_is_local && $_cookie_law_3party == 'true') {
1254 ?>
1255 <!-- if myconsole <body onunload="deconsole();"> -->
1256 <body xmlns:fb="http://ogp.me/ns/fb#">
1257 <div id="fb-root"></div>
1258 <script>(function(d, s, id) {
1259   var js, fjs = d.getElementsByTagName(s)[0];
1260   if (d.getElementById(id)) return;
1261   js = d.createElement(s); js.id = id;
1262   js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
1263   fjs.parentNode.insertBefore(js, fjs);
1264 }(document, 'script', 'facebook-jssdk'));</script>
1265 <?php
1266     }
1267     else {
1268 ?>
1269 <body>
1270 <?php
1271     }
1272     printf($brisk_header_form);
1273     printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1274     printf($brisk_vertical_menu, '', $brisk_donate);
1275
1276     sidebanners_render($G_sidebanner, $G_sidebanner_idx);
1277
1278     printf("</td><td>");
1279 ?>
1280 <!--  =========== tables ===========  -->
1281 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
1282 <table class="macro"><tr><td>
1283 <?php echo "$tables";?>
1284 </td></tr><tr><td>
1285 <?php echo "$standup";?>
1286 </td></tr></table>
1287 </td></tr></table>
1288
1289 <!--  =========== bottom ===========  -->
1290 <div id="bottom" class="bottom">
1291 <b>Chat</b> <span id="list_info" style="color: red;"></span><br>
1292 <div id="txt" class="chatt">
1293 </div>
1294 <div style="text-align: center; ">
1295     <!-- MLANG: scrivi un invito al tavolo e clicca -->
1296     <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;">
1297     <div id="myname"></div>
1298     </td><td>
1299     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
1300     </td></tr></table>
1301 </div>
1302 </div>
1303
1304     <div id="authbox" class="notify" style="text-align: center;">
1305        <br>
1306        <b>
1307     <!-- MLANG: Garantisci per un tuo conoscente: -->
1308 <?php echo $mlang_room['tit_warr'][$G_lang];?>
1309 </b>
1310        <br><br>
1311
1312        <form id="auth_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_authbox(this);">
1313        <input type="hidden" name="realsub" value="666">
1314 <table class="login">
1315 <tr><td>nickname:</td>
1316 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1317 <tr><td>e-mail:</td>
1318 <td><input id="emailid" class="input_text" name="email" type="text" size="24" maxlength="1024" value=""></td></tr>
1319 <tr><td colspan="2" style="text-align: center;">
1320     <!-- MLANG: Garantisci per un tuo conoscente: -->
1321        <input id="subid" name="sub" value=
1322 "<?php echo $mlang_room['btn_send'][$G_lang]; ?>"
1323  type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1324     <!-- MLANG: Garantisci per un tuo conoscente: -->
1325 <input id="cloid" name="clo" value=
1326 "<?php echo $mlang_room['btn_close'][$G_lang]; ?>"
1327 type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1328 </table>
1329     </form>
1330     </div>
1331     <div id="mesgtoadmbox" class="notify_opaque" style="text-align: center;">
1332        <br>
1333 <!--MLANG: Invia un messaggio o una segnalazione all\'amministratore: -->
1334        <b><?php echo $mlang_room['mesgtoadm_tit'][$G_lang];?></b>
1335        <br><br>
1336        <form id="mesgtoadm_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_mesgtoadmbox(this);">
1337        <input type="hidden" name="realsub" value="666">
1338 <table class="login">
1339 <!--MLANG: soggetto -->
1340 <tr><td><b><?php echo $mlang_room['mesgtoadm_sub'][$G_lang];?></b></td>
1341 <td><input id="subjid" class="input_text" name="subj" type="text" size="32" maxlength="255" value=""></td></tr></table>
1342 <table class="login">
1343 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
1344 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
1345 <tr><td colspan="2" style="text-align: center;">
1346        <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;
1347 <input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="submit_click(this);"></td></tr>
1348 </table>
1349     </form>
1350     </div>
1351 <div id="heartbit"></div>
1352 <div id="sandbox"></div>
1353 <div id="imgct"></div>
1354 <div id="logz"></div>
1355 <div id="sandbox2"></div>
1356 <div id="response"></div>
1357 <div id="remark"></div>
1358 <div id="xhrstart"></div>
1359 <div id="xhrlog"></div>
1360 <div id="xhrdeltalog"></div>
1361 </div>
1362 <div id="preferences" class="notify" style="z-index: 200; width: 600px; margin-left: -300px; height: 240px; top: 150px; visibility: hidden;">
1363 <div id="preferences_child" style="border-bottom: 1px solid gray; overflow: auto; height: 370px;">
1364
1365 <h2><?php echo $mlang_room['tit_prefs'][$G_lang]; ?></h2>
1366 <table style="margin: auto;"><tr><td style="vertical-align: top;">
1367 <!--#
1368     #  LISTEN
1369     #-->
1370 <div style="float: left; padding: 8px;">
1371 <table style="border: 1px solid gray;"><tr><th style="background-color: #cccccc;">
1372 <?php echo $mlang_room['itm_list'][$G_lang];?>
1373 </th></tr>
1374 <tr><td><input style="vertical-align: bottom;" id="ra_listen_all" type="radio" name="listen" value="0" onclick="prefs_update('listen');" title="'
1375 <?php echo $mlang_room['listall_desc'][$G_lang];?>
1376 '"><span id="list_all">
1377 <?php echo $mlang_room['tit_listall'][$G_lang];?>
1378 </span></td></tr>
1379 <tr><td><input style="vertical-align: bottom;" id="ra_listen_auth" type="radio" name="listen" value="1" onclick="prefs_update('listen');" title="'
1380 <?php echo $mlang_room['listaut_desc'][$G_lang];?>
1381 '"><span id="list_auth">
1382 <?php echo $mlang_room['tit_listaut'][$G_lang];?>
1383 </span></td></tr>
1384 <tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="2" onclick="prefs_update('listen');" title="'
1385 <?php echo $mlang_room['listisol_desc'][$G_lang];?>
1386 '"><span id="list_isol">
1387 <?php echo $mlang_room['tit_listisol'][$G_lang];?>
1388 </span></td></tr>
1389 </table>
1390 </div>
1391 <?php
1392     if ($user->is_supp_custom()) {
1393 ?>
1394 </td>
1395 <td style="vertical-align: top;">
1396 <!--#
1397     #  SUPPORTER ONLY
1398     #-->
1399 <div style="float: left; padding: 8px;">
1400 <table style="border: 1px solid gray;"><tr><th colspan="4" style="background-color: #cccccc;">
1401 <?php echo $mlang_room['suppcomp_tit'][$G_lang];?>
1402 </th></tr>
1403 <tr>
1404 <th>
1405 <?php echo $mlang_room['suppcomp_fg'][$G_lang];?>
1406 </th><td><input style="width: 3em;" id="s_fg_r" type="text" maxlength="3" size="3" name="s_fg_r"
1407  onchange="prefs_update('supp');" value="255"
1408  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1409    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1410 <td><input style="width: 3em;" id="s_fg_g" type="text" maxlength="3" size="3" name="s_fg_g"
1411  onchange="prefs_update('supp');" value="255"
1412  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1413    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1414 <td><input style="width: 3em;" id="s_fg_b" type="text" maxlength="3" size="3" name="s_fg_b"
1415  onchange="prefs_update('supp');" value="255"
1416  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1417    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1418 </tr>
1419 <tr>
1420 <th>
1421 <?php echo $mlang_room['suppcomp_bg'][$G_lang];?>
1422 </th>
1423 <td><input style="width: 3em;" id="s_bg_r" type="text" maxlength="3" size="3" name="s_bg_r"
1424  onchange="prefs_update('supp');" value="255"
1425  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1426    <span id="list_all"><?php echo $mlang_room['suppcomp_r'][$G_lang];?></span></td>
1427 <td><input style="width: 3em;" id="s_bg_g" type="text" maxlength="3" size="3" name="s_bg_g"
1428  onchange="prefs_update('supp');" value="255"
1429  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1430    <span id="list_all"><?php echo $mlang_room['suppcomp_g'][$G_lang];?></span></td>
1431 <td><input style="width: 3em;" id="s_bg_b" type="text" maxlength="3" size="3" name="s_bg_b"
1432  onchange="prefs_update('supp');" value="255"
1433  title="'<?php echo $mlang_room['suppcomp_range'][$G_lang];?>'">
1434    <span id="list_all"><?php echo $mlang_room['suppcomp_b'][$G_lang];?></span></td>
1435 </tr>
1436 <tr><td colspan="4" style="text-align: center;">
1437 <img id="s_img" class="nobo" src="img/noimg.png">
1438 </td></tr>
1439 </table>
1440 </div>
1441 </td>
1442 <td>
1443 <?php
1444         }
1445         else {
1446 ?>
1447 <input id="s_fg_r" type="hidden" name="s_fg_r">
1448 <input id="s_fg_g" type="hidden" name="s_fg_g">
1449 <input id="s_fg_b" type="hidden" name="s_fg_b">
1450 <input id="s_bg_r" type="hidden" name="s_bg_r">
1451 <input id="s_bg_g" type="hidden" name="s_bg_g">
1452 <input id="s_bg_b" type="hidden" name="s_bg_b">
1453 <input id="s_img"  type="hidden" name="s_bg_b">
1454 <?php
1455         }
1456 ?>
1457 </td></tr></table>
1458 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
1459 <br><br>
1460 <!-- <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]; */ ?> -->
1461 </div>
1462 </div>
1463 <div class="notify_clo">
1464 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
1465 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
1466 <input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
1467 </div>
1468 </div>
1469 <script language="JavaScript">
1470 <!--
1471 cookie_law(null);
1472 // -->
1473 </script>
1474 </body>
1475 </html>
1476 <?php
1477     }
1478 }
1479 ?>