Merge remote-tracking branch 'origin/together-for-fun' into nginx
[brisk.git] / web / briskin5 / index.php
index 80bc798..64e7bc5 100644 (file)
@@ -46,9 +46,13 @@ $mlang_bin5_index = array( 'aucwin' => array( 'it' => 'Hai vinto l\'asta.<br> Sc
                            );
 
 
-function bin5_index_main($transp_type, &$header_out, $addr, $get, $post, $cookie)
+function bin5_index_main($transp_type, $header, &$header_out, $addr, $get, $post, $cookie)
 {
     GLOBAL $G_lang, $mlang_bin5_index;
+
+    $transp_port = ((array_key_exists("X-Forwarded-Proto", $header) &&
+                     $header["X-Forwarded-Proto"] == "https") ? 443 : 80);
+
     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
         unset ($table_idx);
     if (($laststate = gpcs_var('laststate', $get, $post, $cookie)) === FALSE)
@@ -110,13 +114,15 @@ window.onload = function() {
   preferences_update();
 
   sess = "<?php echo "$sess"; ?>";
-  xstm = new xynt_streaming(window, "<?php echo "$transp_type"; ?>", 80, 2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
+  xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>,  2, null /* console */, gst, 'table_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
   xstm.hbit_set(heartbit);
   
   window.onbeforeunload = onbeforeunload_cb;  
   window.onunload = onunload_cb;  
 
   xstm.start();
+
+  addEvent($('select_rules'), "change", function() { act_select_rules(this.value); } );
   // FIXME: add this setTimeout(preload_images into data stream to avoid
   // race on opened socket
   // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct);
@@ -301,6 +307,9 @@ window.onload = function() {
 <div style="width: 95%; /* background-color: red; */ margin: auto; text-align: left;">
 <br><br>
 <input type="checkbox" name="pref_ring_endauct" id="pref_ring_endauct" onclick="pref_ring_endauct_set(this);"><?php echo $mlang_bin5_index['itm_ringauc'][$G_lang] ?>
+    <div>
+        <label>Regole:</label><?php dom_select_rules();?>
+    </div>
 </div>