1
jrjperu
live help
  • 2005/3/15 20:54

  • jrjperu

  • Just popping in

  • Posts: 11

  • Since: 2004/1/14


File o_chat_baixo.php
-----------------------------------------------------------
<?php
$glob = get_cfg_var (register_globals);
if($glob != true){
include("patch.php");
}
if(!isset($action)){
$action = "";
}
include("config.php") ;
include $lang;

if ($action == "sair"){
$fp = fopen ("transcricao.php", "r");
$fs = filesize ("transcricao.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);

$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $string_41 . "</b> : " . $string_35. "</font>";
$fp = fopen ("transcricao.php", "w+");
fwrite ($fp, $buffer);
fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);
// Duplica
$fp = fopen ("transcricao2.php", "r");
$fs = filesize ("transcricao2.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);

$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $string_41 . "</b> : " . $string_35. "</font>";
$fp = fopen ("transcricao2.php", "w+");
fwrite ($fp, $buffer);
fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);

// Triplica
$fp = fopen ("transcricao3.php", "r");
$fs = filesize ("transcricao3.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);

$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $string_41 . "</b> : " . $string_35. "</font>";
$fp = fopen ("transcricao3.php", "w+");
fwrite ($fp, $buffer);
//fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);

print "<SCRIPT>window.top.close()</SCRIPT> \n";
exit;
}

if(!isset($mensagem)){
$mensagem = "";
}
if ($mensagem != "" ) {

$mensagem = str_replace("\'", "'", "$mensagem");
$mensagem = str_replace("\\\"", "\"", "$mensagem");


$fp = fopen ("transcricao.php", "r");
$fs = filesize ("transcricao.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);

////////////
$numero_de_linhas = $num_linhas; //aqui entra o numero de linhas desejado

$array_chat = explode("<br>", $buffer);
$counter = count ($array_chat);

if($counter <= $numero_de_linhas){
$desejo = 1;
}else{
$desejo = $counter - $numero_de_linhas;
}
//echo "<script>alert('$counter')</script>";


$texto = $array_chat[0] . "<br>"; // cabecalho

for ($i=$desejo; $i<=$counter; $i++) {
$texto .= $array_chat[$i] . "<br>";
};


$buffer = rtrim($texto,"<br>");
////////////

$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $nome . "</b> : " . $mensagem . "</font><br>";
$fp = fopen ("transcricao.php", "w");
fwrite ($fp, $buffer);
//fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);
//duplica

$fp = fopen ("transcricao2.php", "r");
$fs = filesize ("transcricao2.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);
////////////
$numero_de_linhas = $num_linhas; //aqui entra o numero de linhas desejado

$array_chat = explode("<br>", $buffer);
$counter = count ($array_chat);

if($counter <= $numero_de_linhas){
$desejo = 1;
}else{
$desejo = $counter - $numero_de_linhas;
}
//echo "<script>alert('$counter')</script>";


$texto = $array_chat[0] . "<br>"; // cabecalho

for ($i=$desejo; $i<=$counter; $i++) {
$texto .= $array_chat[$i] . "<br>";
};


$buffer = rtrim($texto,"<br>");
////////////
$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $nome . "</b> : " . $mensagem . "</font><br>";
$fp = fopen ("transcricao2.php", "w");
fwrite ($fp, $buffer);
//fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);












//triplica

$fp = fopen ("transcricao3.php", "r");
$fs = filesize ("transcricao3.php");
$bytes = $fs;
$buffer = fread($fp, $bytes);
fclose ($fp);

////////////
$mensagem_formatada = "<font color=\"#" . $cor_operador . "\" face=\"Verdana\" size=\"2\"><b>" . $nome . "</b> : " . $mensagem . "</font><br>";
$fp = fopen ("transcricao3.php", "w");
fwrite ($fp, $buffer);
//fwrite ($fp, "<br>");
fwrite ($fp, $mensagem_formatada .
"
");
fclose ($fp);


}

?>
<html>

<head>
<title></title>
<!-- begin script -->
<SCRIPT LANGUAGE="JavaScript">
function converte_string(word){
return escape(word);
}
function sair() {
window.location = 'o_chat_baixo.php?action=sair';
}
function chat(){
window.parent.cima.location.reload();
msg.focus();
}
</script>
<!-- end script -->

<script>
function envia(){
window.location = 'o_chat_baixo.php?mensagem='+converte_string(msg.value) + '&nome=<? echo urlencode($nome); ?>';
}

function save() {
window.open("transcricao3.php","Save","scrollbars=yes,menubar=yes,top=100,left=200,width=420,height=300");
}
</script>
</head>

<body onload="chat()" bgcolor="#CCCCCC" text="black" link="blue" vlink="purple" alink="red" topmargin="3" marginheight="3">
<table border="0" width="384" align="center">
<tr>
<td width="374" height="26">
<p align="center"><font face="Verdana" size="2"><? echo "$string_30"; ?>:</font>&nbsp;<input type="text" name="msg" style="border-width:1; border-style:solid;" size="30">
<input type="submit" name="Entrar" value="<? echo "$string_31"; ?>" onclick="envia()" style="cursor:hand; margin:1; border-width:1; border-style:solid;">
<br><br><input type="button" name="Save" value="<? echo "$string_45"; ?>" onclick="save()" style="cursor:hand; margin:1; border-width:1; border-style:solid;">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="Sair" value="<? echo "$string_10"; ?>" onclick="sair()" style="cursor:hand; margin:1; border-width:1; border-style:solid;"></p>
</td>
</tr>
</table>
</body>

</html>

-----------------------------------------------------------
file ocupado.php
-----------------------------------------------------------
<?php
//include("patch.php");
include("config.php");
include $lang;
?>
<html>

<head>
<title><? echo "$string_4"; ?></title>
</head>

<body bgcolor="white" text="black" link="black" vlink="black" alink="black">
<table align="center" border="1" cellspacing="0" width="396" bordercolordark="white" bordercolorlight="black">
<tr>
<td width="390" height="270" align="center">
<table border="0" width="386">
<tr>
<td width="380">
<p align="center"><img src="logo.jpg" width="150" height="57" border="0"></p>
</td>
</tr>
<tr>
<td width="380">
<p align="center">&nbsp;</p>
</td>
</tr>
<tr>
<td width="380">
<p align="center">&nbsp;</p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><font face="Verdana" size="2"><b><? echo $string_43; ?></b></font></p>
</td>
</tr>
<tr>
<td width="380">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="380">
<p align="center">
&nbsp;<input type="button" name="Entrar" value="<? echo "$string_10"; ?>" onclick="window.close()" style="cursor:hand; margin:1; border-width:1; border-style:solid;"></p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><font face="Verdana" size="1"><br><a href="https://xoops.org" target="_blank"><b>Powered
By Xoops©</b></a></font></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>

</html>
-----------------------------------------------------------
file patch.php
-----------------------------------------------------------

<?php
$erro1 = ini_set ("display_errors", "0");
$erro2 = ini_set ("error_reporting", "2");

$action = $_GET['action'];
$loginf = $_GET['loginf'];
$senhaf = $_GET['senhaf'];
$mensagem = $_GET['mensagem'];
$nome = $_GET['nome'];
?>

-----------------------------------------------------------
file phpinfo.php
-----------------------------------------------------------


<?
phpinfo();






?>

-----------------------------------------------------------
file prechat.php
-----------------------------------------------------------

<?php
$glob = get_cfg_var (register_globals);
if($glob != true){
include("patch.php");
}
include("config.php");
include $lang;
// primeiro verifica se realmente o operador está online
$texto = file ('status_image.php'); // resgata em um array o conteudo do arquivo
if($texto[0]{0} != "1"){ // operador offline
echo "<script>alert('$string_44')</script>\n";
echo "<script>top.window.close();</script>\n";
exit;
}
?>
<html>

<head>
<title><? echo "$string_4"; ?>.......................................................................................</title>
<SCRIPT LANGUAGE="JavaScript">
function converte_string(word){
return escape(word);
}
</SCRIPT>
</head>

<body onload="nome.focus();" bgcolor="white" text="black" link="black" vlink="black" alink="black">
<table align="center" border="1" cellspacing="0" width="396" bordercolordark="white" bordercolorlight="black">
<tr>
<td width="390" height="310" align="center">
<table border="0" width="386">
<tr>
<td width="380">
<p align="center"><img src="logo.jpg" width="150" height="57" border="0"></p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><font face="Verdana" size="2"><b><? echo $string_42; ?></b></font></p>
</td>
</tr>
<tr>
<td width="380">
<p align="center">&nbsp;</p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><font face="Verdana" size="2"><? echo "$string_27"; ?>:</font> &nbsp;&nbsp;<input type="text" name="nome" style="border-width:1; border-style:solid;"></p>
</td>
</tr>
<tr>
<td width="380">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><input type="button" name="Entrar" value="<? echo "$string_3"; ?>" onclick="window.location = 'chat.php?action=novo&nome='+converte_string(nome.value)" style="cursor:hand; margin:1; border-width:1; border-style:solid;">
&nbsp;&nbsp;
&nbsp;&nbsp;<input type="button" name="Entrar" value="<? echo "$string_10"; ?>" onclick="window.close()" style="cursor:hand; margin:1; border-width:1; border-style:solid;"></p>
</td>
</tr>
<tr>
<td width="380">
<p align="center"><font face="Verdana" size="1"><br><a href="http://www.xoops.or" target="_blank"><b>Powered
By Xoops©</b></a></font></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>&nbsp;</p>
</body>

</html>

-----------------------------------------------------------
file pull.php
-----------------------------------------------------------

<?
//include("patch.php");
include("config.php");
include $lang;
?>
<html>

<head>
<title><? echo "$string_4 - $string_21"; ?>..........</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
</head>

<frameset framespacing="0" border="0" rows="99%,*" frameborder="0">
<frame name="cabecalho" scrolling="no" noresize target="principal" src="pull_home.php">
<frame name="principal" src="pull_fechar.php" scrolling="no" noresize>
<noframes>
<body>

<p>Quetions.</p>

</body>
</noframes>
</frameset>

</html>

-----------------------------------------------------------
File pull_fechar.php
-----------------------------------------------------------

<?php
//include("patch.php");
include("config.php") ;
?>

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">
function fechar(){
open("fechar.php?action=fechar","Fechar","top=0,left=1700,width=300,height=50");
}
</SCRIPT>
</HEAD>
<BODY onunload="fechar()" BGCOLOR="#FFFFFF">

</BODY>
</HTML>

-----------------------------------------------------------
file pull_home.php
-----------------------------------------------------------

<?
$erro1 = ini_set ("display_errors", "0");
$erro2 = ini_set ("error_reporting", "2");

$glob = get_cfg_var (register_globals);
if($glob != true){
include("patch.php");
}
include("config.php");
include $lang;
?>
<html>
<head>
<title><? echo "$string_4 - $string_21"; ?>..........</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function executa(){
window.location.reload(true);
}
//-->
</SCRIPT>
</head>
<?php
include("config.php") ;

$tempo_chamadas = $tempo_chamadas * 1000;
print "<body onload=\"timerID=setTimeout('executa()'," . $tempo_chamadas . ")\" topmargin=\"30\"> \n";

$fm = filemtime ("vida.php");
$tp = time();
$df = $tp - $fm;


if ($df > $tempo){ // reinicia o chat
if ( file_exists( "transcricao.php" )){
$un = unlink ("transcricao.php");
$un = unlink ("transcricao2.php");
$un = unlink ("transcricao3.php");
}
if ( file_exists( "alerta2.php" )){
$un = unlink ("alerta2.php");
}
if ( file_exists( "avisado.php" )){
$un = unlink ("avisado.php");
}
if ( file_exists( "alerta.php" )){
$un = unlink ("alerta.php");
}
if ( file_exists( "fecha_janela.php" )){
$un = unlink ("fecha_janela.php");
}

}


if ( file_exists( "alerta2.php" )){
print "<p align=\"center\"><font face=\"Verdana\" size=\"1\"><b>$string_22</b></font>";
print "<br><font color=red face=\"Verdana\" size=\"1\">$string_23</font></p>";
exit;
}

if ( file_exists( "transcricao.php" )){
if ( !file_exists( "avisado.php" )){
$fp = fopen ("alerta.php", "w+");
fwrite ($fp, " ");
fclose ($fp);
print "<script>
function openwin() {
open(\"o_chat.php\",\"Window1365\",\"top=0,left=300,width=420,height=345\");
}
</script>

<p align=\"center\"><font face=\"Verdana\" size=\"1\">$string_24:&nbsp;<a href=\"javascript:openwin();\" title=\"$string_25\">[$string_26]</a></font>
<EMBED src=\"aviso.wav\" width=0 height=0 autostart=true loop=true>
<script>window.top.focus();</script>\n";
exit;
}else{
print "<script>
function openwin() {
open(\"o_chat.php\",\"Window4569\",\"top=0,left=300,width=420,height=300\");
}
</script>
<p align=\"center\"><font face=\"Verdana\" size=\"1\">$string_24:&nbsp;<a href=\"javascript:openwin();\" title=\"$string_25\">[$string_26]</a></font>\n";
exit;
}
}else{
print "<p align=\"center\"><font face=\"Verdana\" size=\"1\"><b>$string_22</b></font>";
print "<br><font color=red face=\"Verdana\" size=\"1\">$string_23</font></p>";
exit;
}


?>

</body>

</html>
-----------------------------------------------------------
File status_image.php
-----------------------------------------------------------


<!--

var helplive = "<img src=\"offline.jpg\">" ;

document.write( helplive ) ;

//-->

----------------------------------------------------------
file vida.php
----------------------------------------------------------
1059945722

----------------------------------------------------------

file vidativa.php
----------------------------------------------------------

<html>

<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function executa(){
window.location.reload(true);
}
//-->
</SCRIPT>
</head>

<body onload="timerID=setTimeout('executa()',10000)" topmargin="0" bgcolor="#CCCCCC">

<?php
if ( file_exists( "transcricao.php" )){
$tp = time();
$fp = fopen ("vida.php", "w+");
fwrite ($fp, $tp);
fclose ($fp);
}


if ( file_exists( "fecha_janela.php" )){
$un = unlink ("fecha_janela.php");
print "<SCRIPT>window.top.close()</SCRIPT> \n";
exit;
}

?>

</body>

</html>

2
tripmon
Re: live help
  • 2005/3/15 22:39

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


Wha????

Login

Who's Online

133 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 133


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits