5 * Copyright (C) 2006-2007 matteo.nastasi@milug.org
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details. You should have received a
16 * copy of the GNU General Public License along with this program; if
17 * not, write to the Free Software Foundation, Inc, 59 Temple Place -
18 * Suite 330, Boston, MA 02111-1307, USA.
24 require_once("brisk.phh");
25 if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
26 echo "Debugging time!";
30 log_load((isset($sess) ? $sess : "XXX"), "LOAD: index.php");
34 GLOBAL $sess, $name, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER;
41 if (isset($BRISK_SHOWHTML) == FALSE) {
47 if (validate_sess($sess)) {
48 $bri->garbage_manager(TRUE);
49 if (($user = &$bri->get_user($sess, &$idx)) != FALSE) {
50 if ($user->stat == "table") {
51 header ("Location: table.php");
59 if ($ACTION == "login" && isset($name)) {
60 $bri->garbage_manager(TRUE);
62 if (($user = &$bri->add_user(&$sess, &$idx, $name, $_SERVER['REMOTE_ADDR'])) != FALSE) {
65 // setcookie ("sess", "", time() + 180);
66 $bri->standup_update(&$user);
68 if (save_data(&$bri) == FALSE) {
69 echo "ERRORE SALVATAGGIO\n";
76 $body .= '<div class="urgmsg"><b>Il nickname deve contenere almeno una lettera o una cifra.</b></div>';
78 $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono più posti liberi. Riprova più tardi.</b></div>';
80 $body .= '<div class="urgmsg"><b>Il tuo nickname è già in uso.</b></div>';
87 if ($BRISK_SHOWHTML == "debugtable") {
90 else if ($BRISK_SHOWHTML == "debuglogin") {
94 if ($ACTION == "room") {
95 $tables .= '<div class="room_tab">';
96 $tables .= '<table class="room_tab" align="center">';
97 for ($i = 0 ; $i < TABLES_N ; $i++) {
101 $tables .= '<div class="room_div"><div class="room_tit"><b>Tavolo '.$i.'</b></div>';
102 $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
103 $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
105 $tables .= '</td>'."\n";
109 $tables .= '</table></div>';
112 $standup .= '<table class="room_standup" align="center"><tr><td>';
113 $standup .= '<div class="room_ex_standup">';
114 $standup .= '<div class="room_tit"><b>Giocatori in piedi</b></div>';
116 $standup .= sprintf('<div id="standup" class="room_standup"></div>');
117 $standup .= '<div id="esco" class="esco"></div>';
118 $standup .= '</div></td></tr></table>';
120 // $tables .= '</td></tr></table>';
123 $tables .= '</td></tr><tr><td>';
124 $tables .= '<table class="room_tab" align="center">';
125 $tables .= '<tr><td>';
126 $tables .= '<div class="room_ex_standup">';
127 $tables .= '<b>Giocatori in piedi</b>';
129 $tables .= sprintf('<div id="standup" class="room_standup"></div>');
130 $tables .= '<div id="esco" class="esco"></div>';
132 // $tables .= '</td></tr></table>';
135 $altout_propag = array( array ( 'url' => 'http://www.alternativeoutput.it',
136 'content' => '<img class="nobo" src="img/altout80x15.png">' ),
137 array ( 'url' => 'http://virtualsky.alternativeoutput.it',
138 'content' => '<img class="nobo" src="img/virtualsky80x15a.gif">' )
141 // seed with microseconds since last "whole" second
142 srand ((double) microtime() * 1000000);
143 // $randval = rand(0,count($altout_propag)-1);
145 $altout_carousel = sprintf('<a target="_blank" href="%s">%s</a>',
146 $altout_propag[$randval]['url'],
147 $altout_propag[$randval]['content']);
150 $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
151 if ($brisk_donate == FALSE)
154 $brisk_header_form = '<div class="container">
155 <!-- =========== header =========== -->
156 <div id="header" class="header">
157 <table width="100%%" border="0" cols="3"><tr>
158 <td align="left"><div style="padding-left: 8px;">
162 <script type="text/javascript"><!--
163 google_ad_client = "pub-5246925322544303";
164 google_ad_width = 234;
165 google_ad_height = 60;
166 google_ad_format = "234x60_as";
167 google_ad_type = "text_image";
168 google_ad_channel = "";
169 google_color_border = "808080";
170 google_color_bg = "f6f6f6";
171 google_color_link = "ffae00";
172 google_color_text = "404040";
173 google_color_url = "000000";
176 <script type="text/javascript"
177 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
183 <td align="center"><div>
184 <img class="nobo" src="img/brisk_logo64.png">
185 briscola chiamata in salsa ajax<br>
187 <td align="right"><div style="padding-right: 8px;">
191 <script type="text/javascript"><!--
192 google_ad_client = "pub-5246925322544303";
193 google_ad_width = 234;
194 google_ad_height = 60;
195 google_ad_format = "234x60_as";
196 google_ad_type = "text_image";
197 google_ad_channel = "";
198 google_color_border = "808080";
199 google_color_bg = "f6f6f6";
200 google_color_link = "ffae00";
201 google_color_text = "404040";
202 google_color_url = "000000";
205 <script type="text/javascript"
206 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
215 $brisk_vertical_menu = '
216 <!-- =========== vertical menu =========== -->
217 <div class="topmenu">
218 <a target="_blank" href="/briskhome.php"><img class="nobo" src="img/brisk_homebutt.png"></a>
220 sponsored by:<br><br>'.$altout_carousel.'<br>
221 <a target="_blank" href="http://www.dynamica.it"><img class="nobo" src="img/dynamica.png"></a><br><br>
222 supported by:<br><br>
223 <a target="_blank" href="http://www.briscolachiamata.it"><img class="nobo" src="img/brichi.png"></a><br><br>
224 <div id="proflashext" class="proflashext"><div id="proflash" class="proflash">
231 if ($ACTION == 'login') {
236 <link rel="shortcut icon" href="img/brisk_ico.png">
237 <script type="text/javascript" src="dnd.js"></script>
238 <script type="text/javascript" src="dom-drag.js"></script>
239 <script type="text/javascript" src="commons.js"></script>
240 <script type="text/javascript" src="xhr.js"></script>
241 <script type="text/javascript" src="preload_img.js"></script>
242 <script type="text/javascript" src="AC_OETags.js"></script>
243 <link rel="stylesheet" type="text/css" href="brisk.css">
244 <link rel="stylesheet" type="text/css" href="room.css">
247 <SCRIPT type="text/javascript">
248 var g_withflash = false;
250 window.onload = function() {
251 g_withflash = DetectFlashVer(6,0,0);
252 if (g_withflash == false) {
253 $("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>';
256 $("proflashext").innerHTML = "";
261 printf($brisk_header_form);
262 printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
263 printf($brisk_vertical_menu, '', '');
267 <!-- =========== tables =========== -->
268 <?php echo "$body"; ?>
270 <div style="text-align: center;">
272 Digita il tuo nickname per accedere ai tavoli della briscola.<br><br>
273 <form method="post" action="">
274 <input id="nameid" name="name" type="text" size="24" maxlength="12" value="">
275 <input id="sub" value="entra" type="submit" class="button">
277 </div></td></tr></table>
280 <div id="imgct"></div>
281 <div id="logz"></div>
282 <div id="sandbox"></div>
283 <div id="sandbox2"></div>
284 <div id="response"></div>
285 <div id="xhrstart"></div>
287 <div id="xhrlog"></div>
289 <div id="xhrdeltalog"></div>
294 else if ($ACTION == 'room') {
299 <link rel="shortcut icon" href="img/brisk_ico.png">
300 <script type="text/javascript" src="dnd.js"></script>
301 <script type="text/javascript" src="dom-drag.js"></script>
302 <script type="text/javascript" src="commons.js"></script>
303 <script type="text/javascript" src="xhr.js"></script>
304 <script type="text/javascript" src="preload_img.js"></script>
305 <script type="text/javascript" src="AC_OETags.js"></script>
306 <link rel="stylesheet" type="text/css" href="brisk.css">
307 <link rel="stylesheet" type="text/css" href="room.css">
310 <SCRIPT type="text/javascript">
314 var gst = new globst();
316 var g_withflash = false;
318 var g_imgtot = g_preload_img_arr.length;
319 var myfrom = "index_php";
320 window.onload = function() {
322 if ($BRISK_SHOWHTML == "debugtable") {
324 room_checkspace(12, <?php echo TABLES_N; ?>, 50);
329 // alert("INDEX START");
330 xhr_rd = createXMLHttpRequest();
331 sess = "<?php echo "$sess"; ?>";
333 window.onunload = onunload_cb;
334 g_withflash = DetectFlashVer(6,0,0);
335 if (g_withflash == false) {
336 $("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>';
339 $("proflashext").innerHTML = "";
340 setTimeout(xhr_rd_poll, 0, sess);
341 // alert("ARR LENGTH "+g_preload_img_arr.length);
342 setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
351 printf($brisk_header_form);
352 printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
353 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>',
357 <!-- =========== tables =========== -->
358 <input name="sess" type="hidden" value="<?php echo "$user->sess"; ?>">
359 <table class="macro"><tr><td>
360 <?php echo "$tables"; ?>
362 <?php echo "$standup"; ?>
366 <!-- =========== bottom =========== -->
367 <div id="bottom" class="bottom" style="/* background-color: green; */">
369 <div id="txt" class="chatt">
371 <table align=center style="width: 98%; margin: auto;"><tr><td style="width:1%; text-align: right;">
372 <div id="myname"></div>
374 <input id="txt_in" type="text" style="width: 100%;" onkeypress="chatt_checksend(this,event);">
377 <div id="heartbit"></div>
378 <div id="sandbox"></div>
379 <div id="imgct"></div>
380 <div id="logz"></div>
381 <div id="sandbox2"></div>
382 <div id="response"></div>
383 <div id="remark"></div>
384 <div id="xhrstart"></div>
385 <div id="xhrlog"></div>
386 <div id="xhrdeltalog"></div>