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