keepalives_eq_max management fixed to have a correct count of seconds
[brisk.git] / web / index.php
1 <?php
2 /*
3  *  brisk - index.php
4  *
5  *  Copyright (C) 2006-2012 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 TODO:
26   - header
27   - setcookie
28   - gestire per intero la var globale di output
29 */
30
31 require_once("Obj/brisk.phh");
32 require_once("Obj/auth.phh");
33 require_once("Obj/proxyscan.phh");
34
35 $mlang_room = array( 'userpasserr'  => array('it' => 'Utente e/o password errati.',
36                                              'en' => 'Wrong user and/or password.'),
37                      'userpassmust' => array('it' => 'Il nickname deve contenere almeno una lettera o una cifra.',
38                                              'en' => 'The nickname have to contain at least one letter or one number.'),
39                      'userpassend'  => array('it' => 'Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.',
40                                              'en' => 'We are sorry, there aren\'t free place. Try again later.'),
41                      'userpassuse'  => array('it' => 'Il tuo nickname &egrave; gi&agrave; in uso.',
42                                              'en' => 'Your nickname is already in use.'),
43                      'standing'     => array('it' => 'Giocatori in piedi',
44                                              'en' => 'Standing players'),
45                      'headline'     => array('it' => 'briscola chiamata in salsa ajax',
46                                              'en' => 'declaration briscola in ajax sauce <b>(Beta)</b>'),
47                      'wellcome'     => array('it' => 'Digita il tuo nickname per accedere ai tavoli della briscola',
48                                              'en' => 'Enter your nickname to access to the tables of briscola'),
49                      'btn_enter'    => array('it' => 'entra',
50                                              'en' => 'enter'),
51                      'passwarn'     => array('it' => 'Se non hai ancora una password, lascia il campo in bianco ed entra.',
52                                              'en' => 'If you don\'t have a password, leave blank the field and enter.'),
53                      'browwarn'     => array('it' => '(se qualcosa non funziona<br>prova a ricaricare la pagina con <b>Ctrl + F5</b>)',
54                                              'en' => '(if something don\'t work<br>try to reload the current page with <b>Ctrl + F5</b>)'),
55                      '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>.',
56                                              '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>.'),
57                      'btn_rettabs'  => array('it' => 'torna ai tavoli',
58                                              'en' => 'back to tables'),
59                      'btn_exit'     => array('it' => 'Esco.',
60                                              'en' => 'Exit.'),
61                      'tit_tabl'     => array('it' => 'Tavolo ',
62                                              'en' => 'Table '),
63                      'tit_stat'     => array('it' => 'imposta lo stato del tuo utente',
64                                              'en' => 'set the status of the user'),
65                      'stat_desc'    => array('it' => 'stato',
66                                              'en' => 'mode' ),
67                      'st_norm_desc' => array('it' => 'normale',
68                                              'en' => 'normal'),
69                      'st_paus_desc' => array('it' => 'pausa',
70                                              'en' => 'pause'),
71                      'st_out_desc'  => array('it' => 'fuori',
72                                              'en' => 'out'),
73                      'st_dog_desc'  => array('it' => 'cane',
74                                              'en' => 'dog'),
75                      'st_food_desc' => array('it' => 'cibo',
76                                              'en' => 'food'),
77                      'st_work_desc' => array('it' => 'lavoro',
78                                              'en' => 'work'),
79                      'st_smok_desc' => array('it' => 'sigaretta',
80                                              'en' => 'smoke'),
81                      'st_pres_desc' => array('it' => 'presente',
82                                              'en' => 'present'),
83                      'st_rabb_desc' => array('it' => 'coniglio',
84                                              'en' => 'rabbit'),
85                      'st_socc_desc' => array('it' => 'calcio',
86                                              'en' => 'soccer'),
87                      'st_baby_desc' => array('it' => 'pupo',
88                                              'en' => 'baby'),
89                      'st_mop_desc'  => array('it' => 'pulizie',
90                                              'en' => 'mop'),
91                      
92                      'tit_ticker'   => array('it' => 'scrivi un invito al tavolo e clicca',
93                                              'en' => 'write an invitation at the table and click'),
94                      'itm_warr'     => array('it' => 'garantisci',
95                                              'en' => 'guarantee'),
96                      'warr_desc'    => array('it' => 'garantisci per un tuo conoscente',
97                                              'en' => 'guarantee for a friend'),
98                      'tit_warr'     => array('it' => 'Garantisci per un tuo conoscente.',
99                                              'en' => 'Guarantee for a friend.'),
100                      'itm_list'     => array('it' => 'ascolta',
101                                              'en' => 'listen'),
102                      'list_desc'    => array('it' => 'imposta le regole di ascolto',
103                                              'en' => 'set the listen rules'),
104                      'tit_listall'  => array('it' => 'tutti',
105                                              'en' => 'everybody'),
106                      'listall_desc' => array('it' => 'leggi tutti i messaggi di tutti gli utenti collegati',
107                                              'en' => 'listen all messages from each user connected'),
108                      'tit_listaut'  => array('it' => 'solo autenticati',
109                                              'en' => 'only authorized'),
110                      'tit_listisol'  => array('it' => 'isolamento',
111                                              'en' => 'isolation'),
112                      'listaut_desc' => array('it' => 'leggi soltanto i messaggi degli utenti con password',
113                                              'en' => 'listen messages only from authenticated users'),
114                      'listisol_desc'=> array('it' => 'visualizza Brisk come se fosse solo per utenti con password',
115                                              'en' => 'show Brisk like an authenticated user only site'),
116                      'tit_splash'   => array('it' => 'splash',
117                                              'en' => 'splash'),
118                      'splash_desc'  => array('it' => 'attiva la finestra di splash',
119                                              'en' => 'show the splash window'),
120                      'tit_help'     => array('it' => 'informazioni utili su Brisk',
121                                              'en' => 'usefull information about Brisk'),
122                      'itm_help'     => array('it' => 'aiuto',
123                                              'en' => 'help'),
124                      'tit_hpage'    => array('it' => 'homepage del progetto',
125                                              'en' => 'project homepage (ita)'),
126                      'tit_what'     => array('it' => 'di cosa si tratta',
127                                              'en' => 'what is the project'),
128                      'itm_what'     => array('it' => 'cos\'&egrave;',
129                                              'en' => 'what is it'),
130                      'url_rules'    => array('it' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5',
131                                              'en' => 'http://it.wikipedia.org/wiki/Briscola#Gioco_a_5&EN=true'),
132                      'itm_rules'    => array('it' => 'regole',
133                                              'en' => 'rules'),
134                      'tit_rules'    => array('it' => 'come si gioca',
135                                              'en' => 'how to play'),
136                      'tit_shot'     => array('it' => 'screenshots dell\'applicazione',
137                                              'en' => 'screenshots of the web-application'),
138                      'tit_comp'     => array('it' => 'compatibilit&agrave; con i browser',
139                                              'en' => 'browsers compatibility'),
140                      'itm_comp'     => array('it' => 'compatibilit&agrave;',
141                                              'en' => 'compatibility'),
142                      'tit_src'      => array('it' => 'sorgenti dell\'applicazione web',
143                                              'en' => 'sources of the web-application'),
144                      'itm_src'      => array('it' => 'sorgenti',
145                                              'en' => 'sources'),
146                      'tit_ml'       => array('it' => 'come iscriversi alla mailing list',
147                                              'en' => 'how to subscribe the mailing list'),
148                      'itm_ml'       => array('it' => 'mailing&nbsp;list',
149                                              'en' => 'mailing&nbsp;list'),
150                      'tit_pro'      => array('it' => 'come fare pubblicit&agrave; a Brisk!',
151                                              'en' => 'how to spread Brisk!'),
152                      'itm_pro'      => array('it' => 'propaganda',
153                                              'en' => 'propaganda'),
154                      'tit_mail'     => array('it' => 'contatti',
155                                              'en' => 'contacts'),
156                      'itm_mail'     => array('it' => 'contatti',
157                                              'en' => 'contacts'),
158                      'tit_cla'      => array('it' => 'classifiche degli utenti',
159                                              'en' => 'user\'s placings'),
160                      'itm_cla'      => array('it' => 'classifiche',
161                                              'en' => 'placings'),
162                      'tit_rmap'     => array('it' => 'prossime funzionalità implementate',
163                                              'en' => 'roadmap of next functionalities'),
164                      'itm_rmap'     => array('it' => 'roadmap',
165                                              'en' => 'roadmap'),
166                      'tit_meet'     => array('it' => 'foto dei raduni di briskisti (serve Facebook)',
167                                              'en' => 'photos of brisk meetings'),
168                      'itm_meet'     => array('it' => 'BriskMeeting',
169                                              'en' => 'BriskMeeting'),
170                      'tit_mesg'     => array('it' => 'manda un messaggio o una segnalazione all\'amministratore del sito',
171                                              'en' => 'send a message or a signalling to the administrator' ),
172                      'mesgtoadm_tit'=> array('it' => 'Invia un messaggio o una segnalazione all\'amministratore:',
173                                              'en' => 'Send a message to the administrator:'),
174                      'mesgtoadm_sub'=> array('it' => 'soggetto:',
175                                              'en' => 'subject:'),
176                      'btn_send'     => array('it' => 'Invia.',
177                                              'en' => 'Send.'),
178                      'btn_close'    => array('it' => 'Chiudi.',
179                                              'en' => 'Close.')
180                      );
181
182
183
184 require_once("briskin5/Obj/briskin5.phh");
185
186 function poll_dom() {
187   GLOBAL $G_with_poll, $G_poll_title, $G_poll_entries;
188
189   if ($G_with_poll) {
190     $ret = sprintf('<div style="padding: 0px;margin: 0px; height: 8px; font-size: 1px;"></div>
191
192 <img class="nobo" src="img/brisk_poll.png" onmouseover="menu_hide(0,0); menu_show(\'menu_poll\');">
193
194 <div style="width: 300px;" class="webstart" id="menu_poll" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
195 <b>%s</b><br><br>
196 <form id="poll_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_pollbox(this);">
197 <input type="hidden" name="realsub" value="666">', $G_poll_title);
198     for ($i = 0 ; $i < count($G_poll_entries) ; $i++) {
199       $ret .= sprintf('<INPUT TYPE="radio" NAME="category" VALUE="%s">%s<hr><br>', $G_poll_entries[$i]['id'],
200                       $G_poll_entries[$i]['cont']);
201     }
202     $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>
203 </form></div>');
204     return ($ret);
205   }
206   else
207     return '';
208 }
209
210 function carousel_top()
211 {
212     $rn = rand(1, 3);
213     return (sprintf('<a target="_blank" href="http://shop.alternativeoutput.it"><img class="nobo" style="display: inline; border: 1px solid #808080;" src="img/briskshop%d.gif"></a>', $rn));
214 }
215
216 function index_main(&$room, $transp_type, &$header_out, $addr, $get, $post, $cookie)
217 {
218     GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all;
219     GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local;
220     GLOBAL $G_with_sidebanner, $G_sidebanner; 
221     GLOBAL $G_with_sidebanner2, $G_sidebanner2; 
222     GLOBAL $G_with_poll;
223     GLOBAL $G_lang, $G_lng, $mlang_room;
224     GLOBAL $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER;
225
226     if (($sess = gpcs_var('sess', $get, $post, $cookie)) === FALSE) 
227         $sess = "";
228     if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
229         unset($name);
230     if (($pass_private = gpcs_var('pass_private', $get, $post, $cookie)) === FALSE)
231         unset ($pass_private);
232     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
233         unset ($table_idx);
234     if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
235         unset ($table_token);
236
237     // Use of proxies isn't allowed.
238     if (!$G_is_local && is_proxy($addr)) {
239         return FALSE;
240     }
241
242   $is_login = FALSE;
243   $body = "";
244   $tables = "";
245   $standup = "";
246   $ACTION = "login";
247   
248   if (isset($BRISK_SHOWHTML) == FALSE) {
249       $is_table = FALSE;
250       log_main("lock Room");
251       $curtime = time();
252       
253       /* Actions */
254       
255       if (validate_sess($sess)) {
256           log_main("pre garbage_manager UNO");
257           $room->garbage_manager(TRUE);
258           log_main("post garbage_manager");
259           if (($user = &$room->get_user($sess, &$idx)) != FALSE) {
260               log_main("user stat: ".$user->stat);
261               if ($user->stat == "table") {
262                   $cookies = new Cookies();
263                   $cookies->add("table_token", $user->table_token, $curtime + 31536000);
264                   $cookies->add("table_idx", $user->table, $curtime + 31536000);
265                   $header_out['cookies'] = $cookies;
266                   $header_out['Location'] = "briskin5/index.php";
267                   return TRUE;
268               }
269               $ACTION = "room";
270           }
271           
272       }
273       
274       if ($ACTION == "login" && isset($name)) {
275           
276           log_main("pre garbage_manager DUE");
277           
278           if (isset($pass_private) == FALSE) {
279               $pass_private = FALSE;
280           }
281           
282           $room->garbage_manager(TRUE);
283           /* try login */
284           if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $addr, $cookie)) != FALSE) {
285               $ACTION = "room";
286               if ($idx < 0) {
287                   $idx = -$idx - 1;
288                   $is_login = TRUE;
289               }
290               
291               log_legal($curtime, $addr, $user, "STAT:LOGIN", '');
292               
293               // recovery lost game
294               if ($user->stat == "table") {
295                   $cookies = new Cookies();
296                   $cookies->add("table_token", $user->table_token, $curtime + 31536000);
297                   $cookies->add("table_idx", $user->table, $curtime + 31536000);
298                   $header_out['cookies'] = $cookies;
299                   $header_out['Location'] = "briskin5/index.php";
300                   return TRUE;
301               }
302               
303               
304               // setcookie ("sess", "", time() + 180);      
305               $room->standup_update(&$user);
306               
307           }
308           else {
309               /* Login Rendering */
310               /* MLANG: "Utente e/o password errati.", "Il nickname deve contenere almeno una lettera o una cifra.", "Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.", "Il tuo nickname &egrave; gi&agrave; in uso." */
311               /*
312                if ($idx == -3) 
313                $body .= '<div class="urgmsg"><b>'.$mlang_room['userpasserr'][$G_lang].'</b></div>';
314                else if ($idx == -2)
315                // $body .= '<div class="urgmsg"><b>Il nickname deve contenere almeno una lettera o una cifra.</b></div>';
316                $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassmust'][$G_lang].'</b></div>';
317                else if ($idx == -1) 
318                // $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.</b></div>';
319                $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassend'][$G_lang].'</b></div>';
320                else
321                // $body .= '<div class="urgmsg"><b>Il tuo nickname &egrave; gi&agrave; in uso.</b></div>';
322                $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassuse'][$G_lang].'</b></div>';
323               */
324               
325               if ($idx == -3) 
326                   $sfx = 'err';
327               else if ($idx == -2)
328                   $sfx = 'must';
329               else if ($idx == -1) 
330                   $sfx = 'end';
331               else
332                   $sfx = 'use';
333               
334               $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
335           }
336       }
337   }
338   /* Rendering. */
339
340   if ($BRISK_SHOWHTML == "debugtable") {
341       $ACTION = "room";
342   }
343   else if ($BRISK_SHOWHTML == "debuglogin") {
344       $ACTION = "login";
345   }
346
347   if ($ACTION == "room") {
348       $tables .= '<div class="room_tab">';
349       $tables .= '<table class="room_tab">';
350       for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
351           if ($user->flags & USER_FLAG_AUTH)
352         $i = $ii;
353           else
354               $i = TABLES_N - $ii - 1;
355           
356           if ($ii % 4 == 0) {
357               $tables .= '<tr id = "tr_noauth'.$ii.'">';
358           }
359           if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $ii < TABLES_AUTH_N) {
360               $tables .= '<td id = "td_noauth'.$ii.'">';
361               
362               $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
363               $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
364               $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
365               $tables .= '</div>';
366               $tables .= '</td>'."\n";
367           }
368           if ($ii % 4 == 3) {
369               $tables .= '</tr>';
370           }
371       }
372       $tables .= '</table></div>';
373       
374       
375       $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
376       $standup .= '<div class="room_ex_standup">';
377       /* MLANG: "Giocatori in piedi" */
378       // $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>';
379       $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
380       
381       $standup .= sprintf('<div id="standup" class="room_standup"></div>');
382       // MLANG Esco.
383       $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>';
384       $standup .= '</div></td></tr></table>';
385   }
386   
387   $altout_sponsor_arr = array( array ( 'id' => 'btn_altout',
388                                        'url' => 'http://www.alternativeoutput.it',
389                                        'content' => 'img/altout80x15.png',
390                                        'content_big' => 'img/logotxt_banner.png'),
391                                array ( 'id' => 'btn_virtualsky',
392                                        'url' => 'http://virtualsky.alternativeoutput.it',
393                                        'content' => 'img/virtualsky80x15a.gif',
394                                        'content_big' => 'img/virtualsky_big.png'),
395                                array ( 'id' => 'btn_dynamica',
396                                        'url' => 'http://www.dynamica.it',
397                                        'content' => 'img/dynamica.png',
398                                        'content_big' => 'img/dynamica_big.png')
399                                );
400   
401   $altout_support_arr = array( array ( 'id' => 'btn_brichi',
402                                        'url' => 'http://www.briscolachiamata.it',
403                                        'content' => 'img/brichi.png',
404                                        'content_big' => 'img/brichi_big.png'),
405                                array ( 'id' => 'btn_foroli',
406                                        'url' => 'http://www.forumolimpia.it',
407                                        'content' => 'img/forumolimpia.gif',
408                                        'content_big' => 'img/forumolimpia_big.png' ) );
409   
410   
411   
412   $altout_support = "";
413   $altout_support_big = "";
414   for ($i = 0 ; $i < 3 ; $i++) {
415       $ii = ($i < 2 ? $i : 0);
416       
417       $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>',
418                                  $i * 20, $altout_support_arr[$ii]['url'],
419                                  $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
420       
421       $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
422                                      $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
423   }
424   
425   
426   // seed with microseconds since last "whole" second
427   // srand ((double) microtime() * 1000000);
428   // $randval = rand(0,count($altout_sponsor_arr)-1);
429   $altout_sponsor = "";
430   $altout_sponsor_big = "";
431   for ($i = 0 ; $i < 4 ; $i++) {
432       $ii = ($i < 3 ? $i : 0);
433       
434       $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>',
435                                  $i * 20, $altout_sponsor_arr[$ii]['url'],
436                                  $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
437       
438       $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
439                                    $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']);
440   }
441   
442   
443   
444   
445   
446   $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
447   if ($brisk_donate == FALSE)
448       $brisk_donate = "";
449   
450   
451   /* MLANG: "briscola chiamata in salsa ajax", */
452   
453   mt_srand(make_seed());
454   if (!$G_is_local) {
455       $rn = rand(0, 1);
456       
457       if ($rn == 0) { 
458           $banner_top_left = '<script type="text/javascript"><!--
459 google_ad_client = "pub-5246925322544303";
460 google_ad_width = 234;
461 google_ad_height = 60;
462 google_ad_format = "234x60_as";
463 google_ad_type = "text_image";
464 google_ad_channel = "";
465 google_color_border = "808080";
466 google_color_bg = "f6f6f6";
467 google_color_link = "ffae00";
468 google_color_text = "404040";
469 google_color_url = "000000";
470 //-->
471 </script>
472 <script type="text/javascript"
473   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
474 </script>';
475           $banner_top_right = carousel_top();
476       }
477       else { 
478           $banner_top_left = carousel_top();
479           $banner_top_right = '<script type="text/javascript"><!--
480 google_ad_client = "pub-5246925322544303";
481 google_ad_width = 234;
482 google_ad_height = 60;
483 google_ad_format = "234x60_as";
484 google_ad_type = "text_image";
485 google_ad_channel = "";
486 google_color_border = "808080";
487 google_color_bg = "f6f6f6";
488 google_color_link = "ffae00";
489 google_color_text = "404040";
490 google_color_url = "000000";
491 //-->
492 </script>
493 <script type="text/javascript"
494   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
495 </script>';
496       }
497   }
498   else { // !$G_is_local
499       $banner_top_left  = carousel_top();
500       $banner_top_right = carousel_top();
501   }
502
503   $brisk_header_form = '<div class="container">
504 <!-- =========== header ===========  -->
505 <div id="header" class="header">
506 <table width="100%%" border="0" cols="3"><tr>
507 <td align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
508 <td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
509     <img class="nobo" src="img/brisk_logo64.png">
510     '.$mlang_room['headline'][$G_lang].'<br>
511     </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>', 
512                                                                 ($G_with_topbanner ? $G_topbanner : 
513 "<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>
514 <td align="right"><div style="padding-right: 8px;">
515 '.$banner_top_right.'</div></td>
516 </tr></table>
517 </div>';
518
519 /* MLANG: ALL THE VERTICAL MENU */
520   $brisk_vertical_menu = '
521 <!--  =========== vertical menu ===========  -->
522 <div class="topmenu">
523 <!-- <a target="_blank" href="/briskhome.php"></a> -->
524
525 <div class="webstart_hilite">
526 <img class="nobo" style="cursor: pointer;" src="img/brisk_start.png" onmouseover="menu_hide(0,0); menu_show(\'menu_webstart\');">
527 <div class="webstart" id="menu_webstart" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
528
529 <a href="#" onmouseover="menu_hide(0,1);" title="'.$mlang_room['tit_help'][$G_lang].'" onclick="act_help();"
530    >'.$mlang_room['itm_help'][$G_lang].'</a><br>
531
532 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php" 
533    onmouseover="menu_hide(0,1);"
534    title="'.$mlang_room['tit_hpage'][$G_lang].'">homepage</a><br>
535
536 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#cose" 
537    onmouseover="menu_hide(0,1);"
538    title="'.$mlang_room['tit_what'][$G_lang].'">'.$mlang_room['itm_what'][$G_lang].'</a><br>
539
540 <a target="_blank" href="'.$mlang_room['url_rules'][$G_lang].'" 
541    onmouseover="menu_hide(0,1);"
542    title="'.$mlang_room['tit_rules'][$G_lang].'">'.$mlang_room['itm_rules'][$G_lang].'</a><br>
543
544 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#shots" 
545    onmouseover="menu_hide(0,1);"
546    title="'.$mlang_room['tit_shot'][$G_lang].'">screenshoots</a><br>
547
548 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#comp" 
549    onmouseover="menu_hide(0,1);"
550    title="'.$mlang_room['tit_comp'][$G_lang].'">'.$mlang_room['itm_comp'][$G_lang].'</a><br>
551
552 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#sources" 
553    onmouseover="menu_hide(0,1);"
554    title="'.$mlang_room['tit_src'][$G_lang].'">'.$mlang_room['itm_src'][$G_lang].'</a><br>
555
556 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#mailing" 
557    onmouseover="menu_hide(0,1);"
558    title="'.$mlang_room['tit_ml'][$G_lang].'">'.$mlang_room['itm_ml'][$G_lang].'</a><br>
559
560 <a target="_blank" href="http://www.alternativeoutput.it/briskhome.php#prop" 
561    onmouseover="menu_hide(0,1);"
562    title="'.$mlang_room['tit_pro'][$G_lang].'">'.$mlang_room['itm_pro'][$G_lang].'</a><br>
563 <a href="#" 
564    onmouseover="menu_hide(0,1);"
565    title="credits" onclick="act_about();">about</a><br>
566
567 <a href="mailto:brisk@alternativeoutput.it" 
568    onmouseover="menu_hide(0,1);"
569    title="'.$mlang_room['tit_mail'][$G_lang].'">'.$mlang_room['itm_mail'][$G_lang].'</a><br>
570
571 <hr>
572
573 <!--
574 <a href="#" 
575    onmouseover="menu_hide(0,1);"
576    title="perché supportare brisk?" onclick="act_whysupport();">supportare?</a><br>
577 -->
578 <a href="#" 
579    onmouseover="menu_hide(0,1);"
580    title="'.$mlang_room['tit_cla'][$G_lang].'" onclick="act_placing();">'.$mlang_room['itm_cla'][$G_lang].'</a><br>
581
582 <a href="#" 
583    onmouseover="menu_hide(0,1);"
584    title="'.$mlang_room['tit_rmap'][$G_lang].'" onclick="act_roadmap();">'.$mlang_room['itm_rmap'][$G_lang].'</a><br>
585
586 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'" 
587    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
588
589 <div style="text-align: right;" id="menu_meeting" class="webstart">
590 <a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
591    target="_blank" onmouseover="menu_hide(0,2);"
592    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>
593
594 <a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
595    target="_blank" onmouseover="menu_hide(0,2);"
596    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>
597
598 <a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
599    target="_blank" onmouseover="menu_hide(0,2);"
600    title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
601
602 <a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
603    target="_blank" onmouseover="menu_hide(0,2);"
604    title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
605
606 <a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
607    target="_blank" onmouseover="menu_hide(0,2);"
608    title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
609
610 <a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1" 
611    target="_blank" onmouseover="menu_hide(0,2);"
612    title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
613
614 <a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1" 
615    target="_blank" onmouseover="menu_hide(0,2);"
616    title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
617
618 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806" 
619    target="_blank" onmouseover="menu_hide(0,2);"
620    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
621
622 <a href="http://www.anomalia.it/mop/photoo" 
623    target="_blank" onmouseover="menu_hide(0,2);"
624    title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
625
626 </div>
627 </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\');">
628
629 <div class="webstart" id="menu_commands" onmouseover="menu_over(1,this);" onmouseout="menu_over(-1,this);">
630
631 <a href="#" title="'
632           // MLANG
633           .$mlang_room['tit_stat'][$G_lang].
634 '" 
635    onmouseover="menu_hide(0,1); menu_show(\'menu_state\');">'
636           // MLANG
637           .$mlang_room['stat_desc'][$G_lang].
638 '</a><br>
639 <div id="menu_state" class="webstart">
640 <a href="#" 
641    onmouseover="menu_hide(0,2);"
642    title="" onclick="act_chatt(\'/st normale\'); menu_over(-1,this);">'
643           // MLANG
644           .$mlang_room['st_norm_desc'][$G_lang].
645 '</a><br>
646
647 <a href="#" 
648    onmouseover="menu_hide(0,2);"
649    title="" onclick="act_chatt(\'/st pausa\'); menu_over(-1,this);">'
650           // MLANG
651           .$mlang_room['st_paus_desc'][$G_lang].
652 '&nbsp;<img class="unbo" src="img/st_pau.png"></a><br>
653
654 <a href="#" 
655    onmouseover="menu_hide(0,2);"
656    title="" onclick="act_chatt(\'/st fuori\'); menu_over(-1,this);">'
657           // MLANG
658           .$mlang_room['st_out_desc'][$G_lang].
659 '&nbsp;<img class="unbo" src="img/st_out.png"></a><br>
660
661 <a href="#" 
662    onmouseover="menu_hide(0,2);"
663    title="" onclick="act_chatt(\'/st cane\'); menu_over(-1,this);">'
664           // MLANG
665           .$mlang_room['st_dog_desc'][$G_lang].
666 '&nbsp;<img class="unbo" src="img/st_dog.png"></a><br>
667
668 <a href="#" 
669    onmouseover="menu_hide(0,2);"
670    title="" onclick="act_chatt(\'/st cibo\'); menu_over(-1,this);">'
671           // MLANG
672           .$mlang_room['st_food_desc'][$G_lang].
673 '&nbsp;<img class="unbo" src="img/st_eat.png"></a><br>
674
675 <a href="#" 
676    onmouseover="menu_hide(0,2);"
677    title="" onclick="act_chatt(\'/st lavoro\'); menu_over(-1,this);">'
678           // MLANG
679           .$mlang_room['st_work_desc'][$G_lang].
680 '&nbsp;<img class="unbo" src="img/st_wrk.png"></a><br>
681
682 <a href="#" 
683    onmouseover="menu_hide(0,2);"
684    title="" onclick="act_chatt(\'/st sigaretta\'); menu_over(-1,this);">'
685           // MLANG
686           .$mlang_room['st_smok_desc'][$G_lang].
687 '&nbsp;<img class="unbo" src="img/st_smk.png"></a><br>
688
689 <a href="#" 
690    onmouseover="menu_hide(0,2);"
691    title="" onclick="act_chatt(\'/st presente\'); menu_over(-1,this);">'
692           // MLANG
693           .$mlang_room['st_pres_desc'][$G_lang].
694 '&nbsp;<img class="unbo" src="img/st_eye.png"></a><br>
695
696 <a href="#" 
697    onmouseover="menu_hide(0,2);"
698    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
699           // MLANG
700           .$mlang_room['st_rabb_desc'][$G_lang].
701 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
702
703 <a href="#" 
704    onmouseover="menu_hide(0,2);"
705    title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
706           // MLANG
707           .$mlang_room['st_socc_desc'][$G_lang].
708 '&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
709
710 <a href="#" 
711    onmouseover="menu_hide(0,2);"
712    title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
713           // MLANG
714           .$mlang_room['st_baby_desc'][$G_lang].
715 '&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
716
717 <a href="#" 
718    onmouseover="menu_hide(0,2);"
719    title="" onclick="act_chatt(\'/st pulizie\'); menu_over(-1,this);">'
720           // MLANG
721           .$mlang_room['st_mop_desc'][$G_lang].
722 '&nbsp;<img class="unbo" src="img/st_mop.png"></a><br>
723
724 <!--
725 <a href="#" 
726    onmouseover="menu_hide(0,2);"
727    title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
728           // MLANG
729           .$mlang_room['st_rabb_desc'][$G_lang].
730 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
731 -->
732 </div>
733
734 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo" 
735    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>
736
737 <a href="#" title="'
738           // MLANG garantisci per un tuo conoscente
739           .$mlang_room['warr_desc'][$G_lang].
740 '" 
741    onmouseover="menu_hide(0,1);" onclick="act_chatt(\'/authreq\'); menu_over(-1,this);">'
742           // MLANG garantisci
743           .$mlang_room['itm_warr'][$G_lang].
744           '</a><br>
745
746
747 <a href="#" title="'
748           // MLANG imposta le regole di ascolto
749           .$mlang_room['list_desc'][$G_lang].
750 '"   onmouseover="menu_hide(0,1); menu_show(\'menu_listen\');">'
751           // MLANG ascolta
752           .$mlang_room['itm_list'][$G_lang].
753 '</a><br>
754 <div id="menu_listen" style="width: 120px;" class="webstart">
755 <!--
756
757 -->
758 <input id="ra_listen_all" type="radio" name="listen" value="all" onclick="act_chatt(\'/listen all\');" title="'
759 .$mlang_room['listall_desc'][$G_lang].
760 '"><span id="list_all">'
761 .$mlang_room['tit_listall'][$G_lang].
762 '</span><br>  
763 <input id="ra_listen_auth" type="radio" name="listen" value="auth" onclick="act_chatt(\'/listen auth\');" title="'
764 .$mlang_room['listaut_desc'][$G_lang].
765 '"><span id="list_auth">'
766 .$mlang_room['tit_listaut'][$G_lang].
767 '</span><br>  
768 <input id="ra_listen_isol" type="radio" name="listen" value="isolation" onclick="act_chatt(\'/listen isolation\');" title="'
769 .$mlang_room['listisol_desc'][$G_lang].
770 '"><span id="list_isol">'
771 .$mlang_room['tit_listisol'][$G_lang].
772 '</span><br>
773 <!--
774 <hr>
775 <a href="#" 
776    onmouseover="menu_hide(0,2);"
777    title="'
778           // MLANG leggo i messaggi di tutti gli utenti collegati
779           .$mlang_room['listall_desc'][$G_lang].
780 '" onclick="act_chatt(\'/listen all\'); menu_over(-1,this);"><span id="list_all">'
781           // MLANG tutti
782           .$mlang_room['tit_listall'][$G_lang].
783 '</span></a><br>
784 <a href="#" 
785    onmouseover="menu_hide(0,2);"
786    title="'
787           // MLANG leggo soltanto i messaggi degli utenti con password
788           .$mlang_room['listaut_desc'][$G_lang].
789           '" onclick="act_chatt(\'/listen auth\'); menu_over(-1,this);"><span id="list_auth">'
790           // MLANG solo autenticati
791           .$mlang_room['tit_listaut'][$G_lang].
792 '</span></a><br>
793
794 <a href="#" 
795    onmouseover="menu_hide(0,2);"
796    title="'
797           // MLANG leggo soltanto i messaggi degli utenti con password
798           .$mlang_room['listisol_desc'][$G_lang].
799           '" onclick="act_chatt(\'/listen isolation\'); menu_over(-1,this);"><span id="list_isol">'
800           // MLANG solo autenticati
801           .$mlang_room['tit_listisol'][$G_lang].
802 '</span></a><br>
803 -->
804 </div>
805 <a href="#" title="'
806           // MLANG garantisci per un tuo conoscente
807           .$mlang_room['splash_desc'][$G_lang].
808 '" 
809    onmouseover="menu_hide(0,1);" onclick="act_splash(); menu_over(-1,this);">'
810           // MLANG garantisci
811           .$mlang_room['tit_splash'][$G_lang].
812           '</a><br>
813
814 </div>'.($G_with_poll ? '' : '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
815 <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();">').'
816 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
817 '.($user->flags & USER_FLAG_AUTH ? '
818 <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()
819  : '
820 <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();">
821 ').'
822
823 ' : '').'
824
825 </div>
826 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
827 sponsored by:<br>
828 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
829 <div id="spon_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */ ">
830 <div style="/*background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_sponsor.'<br>
831 </div></div>
832 <div style="position: absolute;">
833 '.$altout_sponsor_big.'
834 </div>
835 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div>
836 supported by:<br>
837 <div style="padding: 0px; margin: 0px; witdh: 50px; height: 4px; font-size: 1px;"></div>
838 <div id="supp_caro" style="overflow: hidden; height: 18px; /* border: 1px solid red; */">
839 <div style="/* background-color: green; */ text-align: left; position: relative; padding: 0px; margin: 0px; top: 0px; height: 80px;">'.$altout_support.'<br> 
840
841 </div>
842 </div>
843 <div style="position: absolute;">
844 '.$altout_support_big.'
845 </div>
846 <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>
847 <br>
848 <div id="proflashext" class="proflashext"><div id="proflash" class="proflash">
849 </div><br><br></div>
850 %s
851 %s
852 <br></div>';
853     
854   /* Templates. */
855   if ($ACTION == 'login') {
856       $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
857 ?>
858 <html>
859 <head>
860 <title>Brisk</title>
861 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
862 <link rel="shortcut icon" href="img/brisk_ico.png">
863 <script type="text/javascript" src="commons.js"></script> 
864 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
865 <script type="text/javascript" src="menu.js"></script>
866 <script type="text/javascript" src="heartbit.js"></script>
867 <script type="text/javascript" src="xynt-streaming.js"></script>
868 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
869 <script type="text/javascript" src="AC_OETags.js"></script>
870 <script type="text/javascript" src="room.js"></script>
871 <script type="text/javascript" src="md5.js"></script>
872 <script type="text/javascript" src="probrowser.js"></script>
873 <link rel="stylesheet" type="text/css" href="brisk.css">
874 <link rel="stylesheet" type="text/css" href="room.css">
875
876 <SCRIPT type="text/javascript"><!--
877    var g_debug = 0;
878    var g_lang = "<? echo $G_lang; ?>";
879    var g_lng = "<? echo $G_lng; ?>";
880    var g_tables_n = <? echo TABLES_N; ?>;
881    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
882    var g_listen;
883    var g_withflash = false;
884    var g_is_spawn = 0;
885    var gst  = new globst();
886    var topbanner_sfx, topbanner_dx;
887    var g_brow = null;
888    var xstm = null;
889    var sess = "not_connected";
890    var spo_slide, sup_slide;
891
892    window.onload = function() {
893      // alert(window.onbeforeunload);
894      g_brow = get_browser_agent();
895      spo_slide  = new sideslide($('spon_caro'), 80, 20);
896      sup_slide  = new sideslide($('supp_caro'), 60, 20);
897
898      login_init();
899 <?php
900      if ($G_with_topbanner) {
901        printf("     topbanner_init();\n");
902     }
903      if ($G_with_sidebanner) {
904        printf("     sidebanner_init();\n");
905     }
906      if ($G_with_sidebanner2) {
907        printf("     sidebanner2_init();\n");
908     }
909 ?>
910
911      g_withflash = DetectFlashVer(6,0,0);
912      if (g_withflash == false) {
913        $("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>';
914      }
915      else
916        $("proflashext").innerHTML = "";
917      $("nameid").focus();
918    }
919    //-->
920 </SCRIPT>
921 </head>
922 <!-- if myconsole <body onunload="deconsole();"> -->
923 <body>
924 <?php
925     printf($brisk_header_form);
926     printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
927     printf($brisk_vertical_menu, '', '');
928
929    if ($G_with_sidebanner xor $G_with_sidebanner2) {
930      printf("<br><br>");
931    }
932
933    if ($G_with_sidebanner) {
934      printf("%s", $G_sidebanner);
935      if ($G_with_sidebanner2) {
936        printf("<br>");
937      }
938    }
939
940
941    if ($G_with_sidebanner2) {
942      printf("%s", $G_sidebanner2);
943    }
944    printf("</td><td>");
945 ?> 
946
947 <!--  =========== tables ===========  -->
948 <?php 
949
950 /* 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)" */
951 echo "$body"; ?>
952 <br>
953 <div style="text-align: center;">
954    <br><br><br>
955 <?php echo $mlang_room['wellcome'][$G_lang];?>
956 <br><br>
957 <form accept-charset="utf-8" method="post" action="" onsubmit="return j_login_manager(this);">
958 <input id="passid_private" name="pass_private" type="hidden" value="">
959 <table class="login">
960 <tr><td>user:</td>
961 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
962 <tr><td>pwd:</td>
963 <td><input id="passid" class="input_text" name="pass" type="password" size="24" maxlength="64" value=""></td></tr>
964 <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_enter'][$G_lang];?>" type="submit" class="button"></td></tr>
965 </table>
966 </form><br>
967 <b><?php echo $mlang_room['passwarn'][$G_lang];?></b><br><br>
968 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
969 </div>
970 <br><br><br><br>
971 <br><br><br><br>
972 <br><br><br><br>
973 <br><br><br><br>
974 <br><br><br><br>
975
976 <div id="imgct"></div>
977 <div id="logz"></div>
978 <div id="sandbox"></div>
979 <div id="sandbox2"></div>
980 <div id="response"></div>
981 <div id="xhrstart"></div>
982 <pre>
983 <div id="xhrlog"></div>
984 </pre>
985 <div id="xhrdeltalog"></div>
986 </body>
987 </html>
988 <?php
989   }
990   else if ($ACTION == 'room') {
991       $header_out['Content-type'] = "text/html; charset=\"utf-8\"";
992   ?>
993 <html>
994 <head>
995 <title>Brisk</title>
996 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
997 <link rel="shortcut icon" href="img/brisk_ico.png">
998 <script type="text/javascript" src="commons.js"></script>
999 <!-- <script type="text/javascript" src="myconsole.js"></script> -->
1000 <script type="text/javascript" src="menu.js"></script>
1001 <script type="text/javascript" src="ticker.js"></script>
1002 <script type="text/javascript" src="heartbit.js"></script>
1003 <script type="text/javascript" src="xynt-streaming.js"></script>
1004 <script type="text/javascript" src="room.js"></script>
1005 <script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
1006 <script type="text/javascript" src="AC_OETags.js"></script>
1007 <script type="text/javascript" src="probrowser.js"></script>
1008 <link rel="stylesheet" type="text/css" href="brisk.css">
1009 <link rel="stylesheet" type="text/css" href="room.css">
1010 <SCRIPT type="text/javascript"><!--
1011    var sess = "not_connected";
1012    var g_debug = 0;
1013    var g_lang = "<? echo $G_lang; ?>";
1014    var g_lng = "<? echo $G_lng; ?>";
1015    var g_tables_n = <? echo TABLES_N; ?>;
1016    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
1017    var g_listen;
1018    var tra = null;
1019    var stat = "";
1020    var subst = "";
1021    var gst  = new globst();
1022    var g_is_spawn = 0; 
1023    var topbanner_sfx, topbanner_dx;
1024    // var nonunload = false;
1025    var g_withflash = false;
1026    var g_imgct= 0;
1027    var g_imgtot = g_preload_img_arr.length;
1028    var g_brow = null;
1029    var spo_slide, sup_slide;
1030
1031    window.onload = function() {
1032      g_brow = get_browser_agent();
1033      spo_slide  = new sideslide($('spon_caro'), 80, 20);
1034      sup_slide  = new sideslide($('supp_caro'), 60, 20);
1035
1036 <?php
1037 if ($BRISK_SHOWHTML == "debugtable") {
1038 ?>
1039      room_checkspace(12, <?php echo TABLES_N; ?>, 50);
1040 <?php
1041 }
1042 else {
1043 ?>
1044     // alert("INDEX START");
1045      menu_init();
1046 <?php
1047      if ($G_with_topbanner) {
1048        printf("     topbanner_init();\n");
1049      }
1050      if ($G_with_sidebanner) {
1051        printf("     sidebanner_init();\n");
1052     }
1053      if ($G_with_sidebanner2) {
1054        printf("     sidebanner2_init();\n");
1055     }
1056
1057 ?>
1058      sess = "<?php echo "$sess"; ?>";
1059 xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);});
1060      xstm.hbit_set(heartbit);
1061      tra = new train($('room_tit'));
1062      window.onunload = onunload_cb;
1063      window.onbeforeunload = onbeforeunload_cb;
1064      g_withflash = DetectFlashVer(6,0,0);
1065      if (g_withflash == false) {
1066        $("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>';
1067      }
1068      else
1069        $("proflashext").innerHTML = "";
1070
1071      // console.log("session from main: "+sess);
1072      xstm.start();
1073      // alert("ARR LENGTH "+g_preload_img_arr.length);
1074      // FIXME: preload image will be fired by stream instead here
1075      // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); 
1076      $("txt_in").focus();
1077 <?php
1078 if ($is_login) {
1079   /* 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" */
1080   echo show_notify($mlang_room['regwarn'][$G_lang], 0, $mlang_room['btn_rettabs'][$G_lang], 400, 150);
1081 }
1082 ?>
1083 <?php
1084 }
1085 ?>
1086    }
1087    //-->
1088 </SCRIPT>
1089 </head>
1090 <!-- if myconsole <body onunload="deconsole();"> -->
1091 <body>
1092 <?php
1093    printf($brisk_header_form);
1094    printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
1095    /*   printf($brisk_vertical_menu, '<input type="button" class="button" name="xhelp"  value="Help." onclick="act_help();"><br><!-- <br><input type="button" class="button" name="xabout"  value="About." onclick="act_about();">--><br><br><br>',
1096            $brisk_donate);
1097    printf($brisk_vertical_menu, '<input type="button" class="button" name="xhelp"  value="Help." onclick="act_help();"><br><!-- <br><input type="button" class="button" name="xabout"  value="About." onclick="act_about();">--><br>',
1098            $brisk_donate);*/
1099    printf($brisk_vertical_menu, '<!-- <br><input type="button" class="button" name="xabout"  value="About." onclick="act_about();">--><br>',
1100            $brisk_donate);
1101
1102
1103    if ($G_with_sidebanner xor $G_with_sidebanner2) {
1104      printf("<br><br>");
1105    }
1106
1107    if ($G_with_sidebanner) {
1108      printf("%s", $G_sidebanner);
1109      if ($G_with_sidebanner2) {
1110        printf("<br>");
1111      }
1112    }
1113
1114
1115    if ($G_with_sidebanner2) {
1116      printf("%s", $G_sidebanner2);
1117    }
1118
1119    printf("</td><td>");
1120 ?> 
1121 <!--  =========== tables ===========  -->
1122 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
1123 <table class="macro"><tr><td>
1124 <?php echo "$tables"; ?>
1125 </td></tr><tr><td>
1126     <?php echo "$standup"; ?>
1127 </td></tr></table>
1128 </td></tr></table>
1129
1130 <!--  =========== bottom ===========  -->
1131     <div id="bottom" class="bottom">
1132 <b>Chat</b> <span id="list_info" style="color: red;"></span><br>
1133 <div id="txt" class="chatt">
1134 </div>
1135 <div style="text-align: center; ">
1136     <!-- MLANG: scrivi un invito al tavolo e clicca -->
1137     <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;">
1138     <div id="myname"></div>
1139     </td><td>
1140     <input id="txt_in" maxlength="128" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
1141     </td></tr></table>
1142 </div>
1143 </div>
1144
1145     <div id="authbox" class="notify" style="text-align: center;">
1146        <br>
1147        <b>
1148     <!-- MLANG: Garantisci per un tuo conoscente: -->
1149     <?php echo $mlang_room['tit_warr'][$G_lang]; ?>
1150 </b>
1151        <br><br>
1152
1153        <form id="auth_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_authbox(this);">
1154        <input type="hidden" name="realsub" value="666">
1155 <table class="login">
1156 <tr><td>nickname:</td>
1157 <td><input id="nameid" class="input_text" name="name" type="text" size="24" maxlength="12" value=""></td></tr>
1158 <tr><td>e-mail:</td>
1159 <td><input id="emailid" class="input_text" name="email" type="text" size="24" maxlength="1024" value=""></td></tr>
1160 <tr><td colspan="2" style="text-align: center;">
1161     <!-- MLANG: Garantisci per un tuo conoscente: -->
1162        <input id="subid" name="sub" value=
1163 "<?php echo $mlang_room['btn_send'][$G_lang]; ?>"
1164  type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1165     <!-- MLANG: Garantisci per un tuo conoscente: -->
1166 <input id="cloid" name="clo" value=
1167 "<?php echo $mlang_room['btn_close'][$G_lang]; ?>" 
1168 type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1169 </table>
1170     </form>
1171     </div>
1172     <div id="mesgtoadmbox" class="notify_opaque" style="text-align: center;">
1173        <br>
1174 <!--MLANG: Invia un messaggio o una segnalazione all'amministratore: -->
1175        <b><?php echo $mlang_room['mesgtoadm_tit'][$G_lang];?></b>
1176        <br><br>
1177        <form id="mesgtoadm_form" accept-charset="utf-8" method="post" action="" onsubmit="return j_mesgtoadmbox(this);">
1178        <input type="hidden" name="realsub" value="666">
1179 <table class="login">
1180 <!--MLANG: soggetto -->
1181 <tr><td><b><?php echo $mlang_room['mesgtoadm_sub'][$G_lang];?></b></td>
1182 <td><input id="subjid" class="input_text" name="subj" type="text" size="32" maxlength="255" value=""></td></tr></table>
1183 <table class="login">
1184 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
1185 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
1186 <tr><td colspan="2" style="text-align: center;">
1187        <input id="subid" name="sub" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1188 <input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
1189 </table>
1190     </form>
1191     </div>
1192 <div id="heartbit"></div>
1193 <div id="sandbox"></div>
1194 <div id="imgct"></div>
1195 <div id="logz"></div>
1196 <div id="sandbox2"></div>
1197 <div id="response"></div>
1198 <div id="remark"></div>
1199 <div id="xhrstart"></div>
1200 <div id="xhrlog"></div>
1201 <div id="xhrdeltalog"></div>
1202 </div>
1203 </body>
1204 </html>
1205 <?php
1206    }
1207 }
1208
1209 ?>