summaryrefslogtreecommitdiff
path: root/0.2.2/push.pl
blob: 54895920942719485f02645894d0f2120530ae99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/perl -w
use CGI;
$q = new CGI;

print
 $q->header;	 # HTML-Header erzeugen

require config;

&secure_checkip($alias);

########################################
##ANFANG DER ZU STREAMENDEN HTML-DATEI##
########################################

print <<END;
<html>
 <head>
  <script language="JavaScript">
   <!--
    scrolling=true;
    function scroll_wnd() {
     if (scrolling != false) {
      window.scroll(1, 500000);
     }
     window.setTimeout("scroll_wnd()", 100);
    }
    scroll_wnd();
   //-->
  </script>
 </head>
<body bgcolor=000000 link=FFFFFF alink=FFFFEF vlink=FFFFEF>
END

$| = 1; # Cache von Perl ausschalten

#############################
##BEGRÜSSUNGSTEXT SCHREIBEN##
#############################

my $msgfile;

 print
   $q->font( { -size=>1,
               -color=>"ffffff",
               -face=>"arial"},
   	       "$title Copyright by Paul C. Bütow 2k $tmp\n");

if ($var eq "push_logs_html") {
 $msgfile = $tmp;
 print   "<hr><font size=2 color=ffffff face=arial>";
} elsif ($var eq "clear_screen") {
 $msgfile = "data/msgs/$alias";
 &write_file_new($msgfile);
  print DATEI $q->br;
 close DATEI;
} else {
 $msgfile = "data/msgs/$alias";
 print $q->br;
}

open (MSGFILE, $msgfile);

#################################
##ENDLOSSCHLEIFE FÜR DEN STREAM##
#################################

my ($times,$online) = (0,"false");
for (;;) {
 for ($curpos = tell(MSGFILE); <MSGFILE>; $curpos = tell(MSGFILE)) {
  print $_ ;
 }
 $times++;
 if ($times > 29) {			# Nach 30 Sekunden
  print "\n<!--PING//-->";		# Ping zum Browser senden
  $times = 0;				# Sekundenzahl auf 0 zurücksetzen
  $online = "true" if (-e "data/online/users/$alias");
  if ($online eq "false") {
   print "<font size=2 color=red>Aus technischen Gründen bitte auf <a href=\"push.pl?alias=$alias&room=$room&var=clear_screen\">Weiterchatten</a> klicken.</font>";
   exit;
  }
 }
 sleep 1;
 seek(MSGFILE, $curpos, 0); 		# Position wiederherstellen
}