Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: PHP FloodShoutBox problem POMOCY!
Forum PHP.pl > Forum > PHP
Julita
Włożyłam skrypt FloodShoutBox na stronę troszkę go zmodyfikowałam jednak bez modyfikacji także nie działa mi w przeglądarce mozilli. Nie wiem czy coś źle zrobiłam po prostu jak wyczyszczam pamięć podręczną to działa ale jak odświeze juz stronę to pojawiają się chińskie znaki. strona to http://www.polski.lxbfanclub.com/ u dołu storny jest shoutbox POMOCY!
akurczyk
pokaż skrypt to coś poradzimy
Julita
Ok tylko cały niechce mi wejść bo jest za długo... Może ja coś źle robię ? tongue.gif tu jesteś jakaś opcja do kodów? Jakby co podam w częściach:

cz.1

<?php
###########################################################################
#
# LXBFANCLUB.COM
#
# BY JULIA
#
#
############################################################################

//--------------------------------------------------------------------------------------------
// DON'T EDIT THIS FILE
//--------------------------------------------------------------------------------------------
// NO EDITES ESTE ARCHIVO
//--------------------------------------------------------------------------------------------

require("floodconfig.php");
function form(){
global $sitename, $maxchar, $message, $posted, $pemail, $url, $pname, $wname;
$file = "dataflood.db";
$fp = fopen($file, "r") or die("<b>error:</b> can't open file");
$val = file($file);
print "<html>
<head>
<title>$sitename shoutbox</title>
<link rel=\"stylesheet\" href=\"floodstyle.css\" type=\"text/css\">
<script type=\"text/javascript\" src=\"floodjs.js\"></script>
</head>
<body onload=\"window.scrollTo(0,99999);\">
<center>
<a href=\"java script:openpopupall()\" onfocus=\"this.blur();\"><font><b>Zobacz wszystkie wiadomosci</b></font></a>
<TABLE width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">

<TR>
<TD id=\"tdbg2\">$val[5]</TD>
</TR>
<TR>
<TD id=\"tdbg1\">$val[4]</TD>
</TR>
<TR>
<TD id=\"tdbg2\">$val[3]</TD>
</TR>
<TR>
<TD id=\"tdbg1\">$val[2]</TD>
</TR>
<TR>
<TD id=\"tdbg2\">$val[1]</TD>
</TR>
<TR>
<TD id=\"tdbg1\">$val[0]</TD>
</TR>

</TABLE><br>
<FORM METHOD=POST name=\"shoutthis\" ACTION=\"floodbox.php?action=add\" onSubmit=\"submitonce(this)\">
<INPUT TYPE=\"text\" NAME=\"name\" value=\"$pname\" onfocus=\"this.value=''\"><br>
<INPUT TYPE=\"text\" NAME=\"mensaje\" value=\"$posted\" onfocus=\"this.value=''\"><br>
<table width=\"40\"><tr><td id=\"tdc\" align=\"center\">
<script>displaylimit('document.shoutthis.mensaje',$maxchar-1)</script></tr></td></table>
<INPUT TYPE=\"button\" value=\" send \" onClick=\"this.disabled=true; this.form.submit()\"/><INPUT TYPE=\"reset\" value=\" reset \">
</FORM>
</center>
</body>
</html>";

cz2.

fclose($fp);
}
function asteriscos($input){
return $output = str_repeat("*", (strlen($input)));
}
function filtro($input){
global $badwords;
foreach ($badwords as $correct){
$input = str_replace($correct, asteriscos($correct), strtolower($input));
$inputf = ucfirst($input);
}
return $inputf;
}
function emoticon($input){
global $smilies;
foreach($smilies as $value=>$icon){
$input = str_replace($value, $icon, $input);
}
return $input;
}
function makeurl($site, $mail, $name){
if (($site != "http://") && (!empty($site))){
if (($mail != "your@mail.com") && (!empty($mail))){
$namelink = "<a href=\"$site\" target=\"_blank\">$name</a>";
$namemailto = "<a href=\"mailto:$mail\">@</a>";
$nametopost = "$namemailto$namelink";
}else{
$namelink = "<a href=\"$site\" target=\"_blank\">$name</a>";
$namemailto = "@";
$nametopost = "$namemailto$namelink";
}
}else{
if (($mail != "your@mail.com") && (!empty($mail))){
$namemailto = "<a href=\"mailto:$mail\">@</a>";
$namelink = "$name";
$nametopost = "$namemailto$namelink";
}else{
$namelink = "$name";
$namemailto = "@";
$nametopost = "$namemailto$namelink";
}
}
return $nametopost;
}
if ($_GET['action'] == "add"){
$validatem = "/[a-zA-Z0-9]+[a-zA-Z-_0-9.]*@[a-zA-Z0-9-]+.[a-zA-Z]{2,3}[.a-zA-Z]*/";
$validateu = "/^((.*?):\/\/)([^\/:]*)(sad.gif[^\/]*))?([^\?]*\/?)?(\?(.*))?$/";
$validatea = "/[a-zA-Z0-9]+@{1}([a-zA-Z0-9]+)?/";
$smilies = array(":)" => "<img src='smilies/smile.gif' border='0' alt=':)'>",
":(" => "<img src='smilies/sad.gif' border='0' alt=':('>",
":p" => "<img src='smilies/tongue.gif' border='0' alt=':P'>",
":d" => "<img src='smilies/biggrin.gif' border='0' alt=':D'>",
":@" => "<img src='smilies/mad.gif' border='0' alt=':@'>",
":o" => "<img src='smilies/eek.gif' border='0' alt=':o'>",
":s" => "<img src='smilies/confused.gif' border='0' alt=':S'>",
";)" => "<img src='smilies/wink.gif' border='0' alt=';)'>",
"=blush" => "<img src='smilies/blush.gif' border='0' alt='=blush'>",
"=boggle" => "<img src='smilies/boggle.gif' border='0' alt='=boggle'>",
"=cool" => "<img src='smilies/cool.gif' border='0' alt='=cool'>",
"=huh" => "<img src='smilies/huh.gif' border='0' alt='=huh'>",
"=notsure" => "<img src='smilies/notsure.gif' border='0' alt='=notsure'>",
"=ooh" => "<img src='smilies/ooh.gif' border='0' alt='=ooh'>",
"=rolleyes" => "<img src='smilies/rolleyes.gif' border='0' alt='=rolleyes'>",
"=sleep" => "<img src='smilies/sleep.gif' border='0' alt='=sleep'>",
"=stress" => "<img src='smilies/stress.gif' border='0' alt='=stress'>",
"=tired" => "<img src='smilies/tired.gif' border='0' alt='=tired'>",
"=urgh" => "<img src='smilies/urgh.gif' border='0' alt='=urgh'>",
"=worry" => "<img src='smilies/worry.gif' border='0' alt='=worry'>");

$_POST['name'] = strip_tags($_POST['name'], "");
$_POST['name'] = ucfirst (strtolower($_POST['name']));
$_POST['mensaje'] = strip_tags($_POST['mensaje'], "");
$_POST['mensaje'] = filtro($_POST['mensaje']);
$_POST['site'] = strip_tags($_POST['site'], "");
$_POST['site'] = strtolower($_POST['site']);
$_POST['email'] = strip_tags($_POST['email'], "");
$_POST['email'] = strtolower($_POST['email']);

if (($_POST['name'] == "name") || ($_POST['name'] == "Name") || (empty($_POST['name']))){
$message = "Enter name";
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}
elseif (in_array($_POST['name'], $admin)){
$message = "Only Admin can post under $_POST[name] nick";
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}
elseif (preg_match($validatea, $_POST['name'])){
$veradmin = explode("@", $_POST['name']);
if (in_array($veradmin[0], $admin)){
if (($veradmin[1] != $password) || (empty($veradmin[1]))){
$message= "Password incorrect";
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}else{
$_POST['name'] = "$veradmin[0]";
if ($_POST['mensaje'] == "Message"){
$message = "Enter message";
$url = $_POST['site'];
$pemail = $_POST['email'];
$pname = $_POST['name'];
form();
}
elseif (empty($_POST['mensaje'])){
$message = "Enter message";
$url = $_POST['site'];
$pemail = $_POST['email'];
$pname = $_POST['name'];
form();
}
elseif ($maxchar <= strlen($_POST['mensaje'])){
$message = "Message must be less than $maxchar chars";
$url = $_POST['site'];
$pemail = $_POST['email'];
$pname = $_POST['name'];
form();
}
elseif ((!empty($_POST['email'])) && (!preg_match($validatem, $_POST['email']))){
$message = "Enter valid email or left the field empty";
$url = $_POST['site'];
$pname = $_POST['name'];
$posted = $_POST['mensaje'];
form();
}
elseif ((!empty($_POST['site'])) && (!preg_match($validateu, $_POST['site']))){
$message = "Url must start with http:// or<br>left the field empty";
$url = "http://";
$pemail = $_POST['email'];
$pname = $_POST['name'];
$posted = $_POST['mensaje'];
form();
}else{
$file = "dataflood.db";
if (file_exists($file)){
$fp = fopen($file, "r+") or die("<b>error:</b> can't open file");
$read = fread($fp, filesize($file));
rewind($fp);
$cookiename=$_POST['name'];
$cookieurl=$_POST['site'];
$cookiemail=$_POST['email'];
setcookie("flood_name", "$cookiename", time()+7776000);
setcookie("flood_site", "$cookieurl", time()+7776000);
setcookie("flood_email", "$cookiemail", time()+7776000);
$nametopost = makeurl($_POST['site'], $_POST['email'], $_POST['name']);
$_POST['mensaje'] = wordwrap($_POST['mensaje'], $maxlenword, " ", 1);

$_POST['mensaje'] = emoticon($_POST['mensaje']);
$_POST['mensaje'] = stripslashes($_POST['mensaje']);
$write = fwrite($fp, "<font color=red><b>::</b></font><b>$nametopost</b>: $_POST[mensaje]\n".$read);
fclose($fp);
print "<meta http-equiv=\"refresh\" content=\"0; URL=floodbox.php\">";
}else{
print "<b>error:</b> dataflood.db must be in the same dir than this script";
}
}
}
}else{
$message = "Bad admin name";
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}
}
elseif ($namemaxchar <= strlen($_POST['name'])){
$message = "Username must be less than $namemaxchar chars";
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}
elseif (($_POST['mensaje'] == "Message") || (empty($_POST['mensaje'])) || ($_POST['mensaje'] == "message")){
$message = "Enter message";
$url = $_POST['site'];
$pemail = $_POST['email'];
$pname = $_POST['name'];
form();
}
elseif ($maxchar+1 <= strlen($_POST['mensaje'])){
$message = "Message must be less than $maxchar chars";
$url = $_POST['site'];
$pemail = $_POST['email'];
$pname = $_POST['name'];
form();
}
elseif ((!empty($_POST['email'])) && (!preg_match($validatem, $_POST['email']))){
$message = "Enter valid email or left the field empty";
$url = $_POST['site'];
$pname = $_POST['name'];
$posted = $_POST['mensaje'];
form();
}

elseif ((!empty($_POST['site'])) && (!preg_match($validateu, $_POST['site']))){
$message = "Url must start with http:// or<br>left the field empty";
$url = "http://";
$pemail = $_POST['email'];
$pname = $_POST['name'];
$posted = $_POST['mensaje'];
form();
}else{
if ((!empty($_COOKIE['flood_anti'])) && (time() - $_COOKIE['flood_anti'] <= $floodtime)){
$message = "The time allowed between posts is: <b>$floodtime</b> seconds";
$pname = $_POST['name'];
$wname = $_POST['name'];
$url = $_POST['site'];
$pemail = $_POST['email'];
$posted = $_POST['mensaje'];
form();
}else{
$file = "dataflood.db";
if (file_exists($file)){
$fp = fopen($file, "r+") or die("<b>error:</b> can't open file");
$read = fread($fp, filesize($file));
rewind($fp);
$cookiename=$_POST['name'];
$cookieurl=$_POST['site'];
$cookiemail=$_POST['email'];
setcookie("flood_name", "$cookiename", time()+7776000);
setcookie("flood_site", "$cookieurl", time()+7776000);
setcookie("flood_email", "$cookiemail", time()+7776000);
setcookie("flood_anti", time(), time()+3600);
$nametopost = makeurl($_POST['site'], $_POST['email'], $_POST['name']);

$_POST['mensaje'] = wordwrap($_POST['mensaje'], $maxlenword, " ", 1);
$_POST['mensaje'] = emoticon($_POST['mensaje']);
$_POST['mensaje'] = stripslashes($_POST['mensaje']);
$write = fwrite($fp, "::<b>$nametopost</b>: $_POST[mensaje]\n".$read);
fclose($fp);
print "<meta http-equiv=\"refresh\" content=\"0; URL=floodbox.php\">";
}else{
print "<b>error:</b> dataflood.db must be in the same dir than this script";
}
}
}
}elseif ($_GET['action'] == "viewall"){
$file = "dataflood.db";
$fp = fopen($file, "r") or die("<b>error:</b> can't open file");
$val = file($file);
$valr = array_reverse($val);
$todos = sizeof($valr);
if ((isset($_COOKIE['flood_name'])) && ($_COOKIE['flood_name'] != "")){
$waname = $_COOKIE['flood_name'];
}else{
$waname = "Guest!";
}
print "<html>
<head>
<title>SHOUTBOX</title>
<link rel=\"stylesheet\" href=\"floodstyle.css\" type=\"text/css\">
</head>
<body onload=\"window.scrollTo(0,99999);\">
<center>

<TABLE width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
$i=-1;
while($i < $todos){
$i++;
print "<TR>
<TD id=\"tdbg4\">$valr[$i]</TD>
</TR>";
$i++;
print"<TR>
<TD id=\"tdbg3\">$valr[$i]</TD>
</TR>";
}

print "</TABLE>
<br><br><font>LXBFANCLUB.COM - THE OFFICIAL INTEERNATIONAL FANCLUB</font><br><br>
</center>

</body>
</html>";

fclose($fp);
}elseif ($_GET['action'] == "help"){
print "<html>
<head>
<title>LXBFANCLUB.COM - HELP</title>
<link rel=\"stylesheet\" href=\"floodstyle.css\" type=\"text/css\">
<script type=\"text/javascript\" src=\"floodjs.js\"></script>
</head>
<body>
<center>

<TABLE width=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">

<tr>
<td id=\"tdc\" align=\"center\"><b>LXBFANCLUB.COM | THE OFFICIAL INTERNATIONAL FANCLUB</b><br><br>
Very easy, when you write:<br>
<b>:)</b> will be replaced with <img src=\"smilies/smile.gif\" border=0 alt=smile.gif><br><br>
When your write:<br>
<b>=ooh</b> will be replaced with <img src=\"smilies/ooh.gif\" border=0 alt==ooh>
<br><br>
Here is a list with all the smilies available:<br>

<table width=\"140\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><br><br>
<tr><td width=\"50%\" align=\"center\"> smile.gif </td><td width=\"50%\" align=\"center\"> <img src=\"smilies/smile.gif\" border=0 alt=smile.gif> </td>
<tr><td width=\"50%\" align=\"center\"> sad.gif </td><td width=\"50%\" align=\"center\"> <img src=\"smilies/sad.gif\" border=0 alt=sad.gif> </td>

tutaj jest masa tych emotikonów i dalej...


</tr></table><br><br>

</td>
</tr>
</TABLE>
</center>
</body>
</html>";
}else{
if (isset($_COOKIE['flood_name'])){
if ($_COOKIE['flood_name'] == ""){
$wname = "Guest!";
$pname = "name";
$pemail="your@mail.com";
$url="http://";
}else{
if ((empty($_COOKIE['flood_site'])) || ($_COOKIE['flood_site'] == "")){
if ((empty($_COOKIE['flood_email'])) || ($_COOKIE['flood_email'] == "")){
$wname = $_COOKIE['flood_name'];
$pname = $_COOKIE['flood_name'];
$url = "http://";
$pemail = "your@mail.com";
}else{
$wname = $_COOKIE['flood_name'];
$pname = $_COOKIE['flood_name'];
$url = "http://";
$pemail = $_COOKIE['flood_email'];
}
}else{
if ((empty($_COOKIE['flood_email'])) || ($_COOKIE['flood_email'] == "")){
$wname = $_COOKIE['flood_name'];
$pname = $_COOKIE['flood_name'];
$url = $_COOKIE['flood_site'];
$pemail = "your@mail.com";
}else{
$wname = $_COOKIE['flood_name'];
$pname = $_COOKIE['flood_name'];
$url = $_COOKIE['flood_site'];
$pemail = $_COOKIE['flood_email'];
}
}
}
}else{
$wname = "Guest!";
$pname = "name";
$pemail="your@mail.com";
$url="http://";
}
$message="";
$posted="message";
form();
}
?>
Cysiaczek
Proszę dodać bbcode do listingu
Julita
Wyskakuje mi że tekst jest za długi... Jest ktoś w stanie mi pomóc?!
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.