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