diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
| commit | 630af0ed6c0af69c7df2e45aef7a87722a3c00c0 (patch) | |
| tree | ad76f850278b090f7e5c26561035d19c320400cc /0.2.5a2/push.pl | |
| parent | 2860b03f00e48264ed15c132ad90b240ebe6070b (diff) | |
tagging ychat-perl-legacyychat-perl-legacy
Diffstat (limited to '0.2.5a2/push.pl')
| -rw-r--r-- | 0.2.5a2/push.pl | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/0.2.5a2/push.pl b/0.2.5a2/push.pl new file mode 100644 index 0000000..1cc55f0 --- /dev/null +++ b/0.2.5a2/push.pl @@ -0,0 +1,97 @@ +#!/usr/bin/perl -w
+
+# yChat - Copyright by Paul C. Bütow
+
+use CGI;
+CGI->compile(':all');
+$q = new CGI;
+
+$| = 1; # Cache von Perl ausschalten
+
+print
+ $q->header; # HTML-Header erzeugen
+
+require config;
+
+&secure_checkip($alias);
+
+########################################
+##ANFANG DER ZU STREAMENDEN HTML-DATEI##
+########################################
+
+print <<END;
+<html>
+ <head>
+<script language="JavaScript">
+<!--
+// Scroll-Routine von Anklepper (http://www.anklepper.de)
+// speziell für yChat (http://www.yChat.de), Copyright 2000
+scrolling = true;
+moves_steps = 4; // Schrittgröße
+moves_interval = 4; // Schrittgeschwindigkeit
+
+function moves()
+{
+ if( scrolling != false )
+ window.scrollBy( 0, moves_steps );
+ window.setTimeout( "moves()", moves_interval );
+}
+
+moves();
+//-->
+</script>
+ </head>
+<body bgcolor=000000 link=FFFFFF alink=FFFFEF vlink=FFFFEF>
+END
+
+#############################
+##BEGRÜSSUNGSTEXT SCHREIBEN##
+#############################
+
+my $msgfile;
+
+ print
+ $q->font( { -size=>1,
+ -color=>"ffffff",
+ -face=>"arial"},
+ "$title Created & Copyright by Paul C. Bütow $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 PUSH##
+###############################
+
+my ($times,$online) = (0,"false");
+for (;;) {
+ for ($curpos = tell(MSGFILE); <MSGFILE>; $curpos = tell(MSGFILE)) {
+ print $_ ;
+ }
+ $times++;
+ if ($times > 14) { # Nach 15 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;
+ }
+ $online = "false"
+ }
+ sleep 1;
+ seek(MSGFILE, $curpos, 0); # Position wiederherstellen
+}
+
|
