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