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