1
jrjperu
live help
  • 2005/3/15 19:52

  • jrjperu

  • Just popping in

  • Posts: 11

  • Since: 2004/1/14


file chat.php
---------------------------------------------------
<?php
include("config.php") ;
include $lang;

$glob = get_cfg_var (register_globals);
if($glob != true){
include("patch.php");
}


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

if ($nome == ""){
$nome = $string_28;//Guest
}
if ($action == "novo") {
if ( file_exists( "transcricao.php" ))
{
echo "<script>window.location.href='$url_chat/ocupado.php'</script>";
exit ;
}
$tp = time();
$fp = fopen ("vida.php", "w+");
fwrite ($fp, $tp);
fclose ($fp);
$fp = fopen ("transcricao.php", "w+");
fwrite ($fp, "<HTML><HEAD><META HTTP-EQUIV=Refresh CONTENT=" . $tempo_chats . "><META HTTP-EQUIV=Pragma CONTENT=no-cache><TITLE></TITLE></HEAD><body onload=\"self.scrollTo(0,900000000);\" topmargin=\"0\"><p><br><font face=\"Verdana\" size=\"2\"><b>" . $nome . "</b>, " . $string_39 . "</font>");
fclose ($fp);

// Duplica
$fp = fopen ("transcricao2.php", "w+");
fwrite ($fp, "<HTML><HEAD><META HTTP-EQUIV=Refresh CONTENT=" . $tempo_chats . "><META HTTP-EQUIV=Pragma CONTENT=no-cache><TITLE></TITLE></HEAD><body onload=\"self.scrollTo(0,900000000);\" topmargin=\"0\"><p><br><font face=\"Verdana\" size=\"2\"><b>" . $nome . "</b>, " . $string_39 . "</font>");
fclose ($fp);

// Triplica
$fp = fopen ("transcricao3.php", "w+");
fwrite ($fp, "<HTML><HEAD><TITLE>" . $string_4 . "</TITLE></HEAD><body onload=\"self.scrollTo(0,900000000);\" topmargin=\"0\"><p><br><font face=\"Verdana\" size=\"2\"><b>" . $nome . "</b>, " . $string_39 . "</font>");
fclose ($fp);

}
if ($action == "") {
$tp = time();
$fp = fopen ("vida.php", "w+");
fwrite ($fp, $tp);
fclose ($fp);
}
?>
<HTML><HEAD><TITLE><? echo "$string_4"; ?> - <? echo "$string_29"; ?> ...............................................................</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function fechar(){
open("fechar2.php?action=fechar_usuario","Fechar_u","top=0,left=1700,width=50,height=50");
}
</SCRIPT>
</HEAD>

<frameset onunload="fechar()" rows="*,80,1" framespacing="0" border="0" frameborder="0">
<frame name="cima" scrolling="auto" noresize src="transcricao.php">
<frame name="baixo" scrolling="no" noresize src="chat_baixo.php?nome=<? echo urlencode($nome); ?>">
<frame name="superbaixo" scrolling="no" noresize src="vidativa.php">
</frameset>
</HTML>

2
jrjperu
Re: live help
  • 2005/3/15 19:55

  • jrjperu

  • Just popping in

  • Posts: 11

  • Since: 2004/1/14


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

if ($action == "sair"){
print "<SCRIPT>window.top.close()</SCRIPT> \n";
}
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_usuario . "\" face=\"Verdana\" size=\"2\"><b>" . $nome . "</b> : " . $mensagem . "</font><br>\n";
$fp = fopen ("transcricao.php", "w");
fwrite ($fp, $buffer);
//fwrite ($fp, "<br>\n");
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_usuario . "\" 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_usuario . "\" 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 codigo -->
<SCRIPT LANGUAGE="JavaScript">
function converte_string(word){
return escape(word);
}
function sair() {
window.location = 'chat_baixo.php?action=sair';
}
function chat(){
window.parent.cima.location.reload();
msg.focus();
}
</SCRIPT>
<!-- end codigo -->

<script>
function envia(){
window.location = '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>

<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>
<p>&nbsp;</p>
</body>

</html>

3
jrjperu
Re: live help
  • 2005/3/15 19:58

  • jrjperu

  • Just popping in

  • Posts: 11

  • Since: 2004/1/14


file config.php
----------------------------------------------------------
<?

/*Login para o operador*/
/*Login for operator*/
$login = "admin";

/*Senha para o operador*/
/*Password for operator!*/
$senha = "chat";

/*Tempo (em segundos) para verificar nova chamada
Recomendado: 10 */
/*Time (in seconds) for verification of new calls
Recommended: 10 */
$tempo_chamadas = 10;

/*Tempo (em segundos) para atualizar a janela de chat
Recomendado: 5 */
/*Time (in seconds) for update of the windows of chat
Recommended: 5 */
$tempo_chats = 5;

/*Cor usada pelo visitante no Chat*/
/*Color that will be used by the Visitor in the Chat*/
$cor_usuario = "000000";

/*Cor usada pelo operador no Chat*/
/*Color that will be used by the Operator in the Chat*/
$cor_operador = "FF9900";

/*The URL of the Chat = "http://www.yourdomain.com/livehelp/"; */
$url_chat = "http://www.yourdomain.com/livehelp";

/*The URL of its Site = "http://www.yourdomain.com/"; */
$pagina_inicial = "http://www.yourdomain.com";

/*
Email para onde deve ser enviadas as mensagens caso o operador esteja OFFLINE
Não esqueca de colocar uma "\" antes do "@"

Email for where the messages must be sent case the Operator is OFFLINE
don't forget to place one "\" before "@"
*/
$mail = "your@mail.com";

/*
Tempo (em segundos) para iniciar nova sessao de chat.
Minimo recomendado: 60

Time (in seconds) for the release of new session of chat.
Recommended minimum: 60
*/
$tempo = 60;

/*
Numero de linhas que aparecem na janela de chat
Recomendado: 15

Number of lines show on window chat
Recommended: 15
*/
$num_linhas = 15;

/*
Pasta atual
Current folder
*/
$var_status_image = "help";

/*
Linguagem
Language


language_english.php

*/
$lang = "language_english.php";



$var_js_function = "fun_" . $var_status_image;
$var_js_window = "var_window" . $var_status_image;
$demo = "off";


?>

Login

Who's Online

115 user(s) are online (69 user(s) are browsing Support Forums)


Members: 0


Guests: 115


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