A więc, poszukałem w internecie shoutboxa i znalazłem, ale problem polega na tym że nie wiem jak dodać pytanie chroniące przed botem, jak dodam je w innym module to wywala błędy.
Kod Shoutboxa:
<?
/*****************************************************/
/* jPORTAL - internetowy system portalowy */
/*****************************************************/
/* autor: Pawel 'jaco' Jaczewski */
/* email: */
/*****************************************************/
include ('config.php');
#===========================#
function site_main() {
global $tresc, $imie, $all, $ip, $REMOTE_ADDR, $emots, $prefix, $PHP_SELF;
if(is_user_login()=='yes')
$info = get_user_info();
main_title_open();
main_title_close();
main_text_open();
#=================#
$shoutbox = $prefix.'shoutbox';
#=================#
if ($tresc!="" && $imie!="") {
$zapytanie = "INSERT INTO $shoutbox SET tresc='$tresc', imie='$imie', ip='$ip'";
$dalej="shoutbox.php";
}
if ($all!=ok) {
$zapytanie = "SELECT * FROM $shoutbox ORDER BY id DESC LIMIT 10";
$wiersz['tresc'] = smilies($wiersz['tresc']);
$wiersz['imie'] = smilies($wiersz['imie']);
echo ("Napisał: <b>".$wiersz['imie']."</b><br>".$wiersz['tresc']."<br>");echo
'<hr size="1" noshade>'; }
echo ("<center>[<a href=?all=ok> Zobacz wszystkie wpisy </a>]</center><br>");
}
<script language="JavaScript">
function emoticon(tresc) {
tresc = \'\' + tresc + \'\';
if (document.shoutbox.tresc.createTextRange && document.shoutbox.tresc.caretPos) {
var caretPos = document.shoutbox.tresc.caretPos;
caretPos.tresc = caretPos.tresc.charAt(caretPos.tresc.length - 1) == \' \' ? tresc + \' \' : tresc;
document.shoutbox.tresc.focus();
} else {
document.shoutbox.tresc.value += tresc;
document.shoutbox.tresc.focus();
}
}
</script>
<table width="95%" align="center">
<tr>
<td class="uni_01" valign="top">
<td width="70%"><form name="shoutbox" method="post" action="shoutbox.php">
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr>
<td width="30%" class="uni_01" align="right" valign="top"><b>imię</b></td>
<td width="70%" class="uni_01">';
if(is_user_login
()=='yes') echo '<b>'.$info[1].'<input type="hidden" name="imie" value="'.$info[1].'">'; else
echo '<input type="text" name="imie" value="'.$imie.'" size="35">';
</tr>
<tr>
<td width="30%" class="uni_01" align="right" valign="top"><b>treść</b></td>
<td width="70%" class="uni_01">
<textarea name="tresc" cols="50" rows="10"></textarea>
</td>
</tr>
<tr>
<td width="30%" class="uni_01" align="right"> </td>
<td width="70%" class="uni_01">
<input type="hidden" name="ip" value="'.$REMOTE_ADDR.'">
<input style="font-weight: bold;" type="submit" name="ok" value="dodaj">
<input type="reset" name="Reset" value="wyczyść">
</td>
</tr>
</table>
</form></td>
</tr>
</table>';
if ($all=='ok') {
$zapytanie = "SELECT * FROM $shoutbox ORDER BY id DESC";
$wiersz['tresc'] = smilies($wiersz['tresc']);
$wiersz['imie'] = smilies($wiersz['imie']);
echo ("<br>Napisał: <b>".$wiersz['imie']."</b><br>".$wiersz['tresc']."<br>");echo
'<hr size="1" noshade>'; }
echo ("<center>[<a href=\"java script:history.back(1)\">Powrót</a>]</center><br>"); }
main_text_close();
}
#=====================================================#
$site_title = 'Myslodsiewnia';
$meta_info = '';
include("theme/$theme/normal.php");
?>