"; function inputstr($txt) { $file = "inputchr.dat"; $handle = fopen($file, "r"); $n = fread($handle, 3); for ($i = 0; $i < $n; $i++) { $nn = fread($handle, 1); $s = ""; for ($ii = 0; $ii < $nn; $ii++) $s .= chr(fread($handle, 3)); $c = fread($handle, 1); $txt = str_replace($s, $c, $txt); } fclose($handle); $txt = str_replace('\\\\', '\\', $txt); $txt = str_replace('\\\'', '\'', $txt); $txt = str_replace('\\"', '"', $txt); $txt = str_replace(chr(13) . chr(10), chr(1), $txt); $txt = str_replace(chr(10), chr(1), $txt); $txt = str_replace(chr(13), chr(1), $txt); $txt = str_replace("**", chr(1), $txt); $txt = str_replace("*A", 'Á', $txt); $txt = str_replace("*a", 'á', $txt); $txt = str_replace("*E", 'É', $txt); $txt = str_replace("*e", 'é', $txt); $txt = str_replace("*I", 'Í', $txt); $txt = str_replace("*i", 'í', $txt); $txt = str_replace("*O:", 'Ö', $txt); $txt = str_replace("*o:", 'ö', $txt); $txt = str_replace("*O=", 'Ő', $txt); $txt = str_replace("*o=", 'ő', $txt); $txt = str_replace("*O", 'Ó', $txt); $txt = str_replace("*o", 'ó', $txt); $txt = str_replace("*U:", 'Ü', $txt); $txt = str_replace("*u:", 'ü', $txt); $txt = str_replace("*U=", 'Ű', $txt); $txt = str_replace("*u=", 'ű', $txt); $txt = str_replace("*U", 'Ú', $txt); $txt = str_replace("*u", 'ú', $txt); return $txt; } function outputusr($s) { $s = str_replace("&", '&', $s); $s = str_replace("<", '<', $s); $s = str_replace(">", '>', $s); return $s; } function outputstr($s) { $s = str_replace("&", '&', $s); $s = str_replace("<", '<', $s); $s = str_replace(">", '>', $s); $s = str_replace(chr(1), $GLOBALS["brcmd"], $s); $s = " " . $s; $ss = ""; while ($s != "") { if ((strlen($s) >= 8) && (substr($s, 0, 8) == " http://")) { $s = substr($s, 1, strlen($s) - 1); $lnk = ""; while (($s != "") && ($s[0] != " ")) { $lnk = $lnk . $s[0]; $s = substr($s, 1, strlen($s) - 1); } $ss = $ss . " $lnk"; } else { $ss = $ss . $s[0]; $s = substr($s, 1, strlen($s) - 1); } } $s = substr($ss, 1, strlen($ss) - 1); return $s; } $tim = time(); echo "
"; if ($sid == "sign") { echo "
Név:

Szöveg:

"; exit; } if ($pos == NULL) $pos = 0; if ($usr != NULL) { $usr = inputstr($usr); if (strlen($usr) > $namlng) $usr = substr($usr, 0, $namlng - 3) . "..."; } if ($txt != NULL) { $txt = inputstr($txt); if (strlen($txt) > $txtlng) $txt = substr($txt, 0, $txtlng - 3) . "..."; } $handle = fopen($file, "r"); $_usr[] = ""; $_tim[] = ""; $_tt[] = ""; $_num[] = ""; $_txt[] = ""; $n = fread($handle, 6) + 0; for ($i = 0; $i < $n; $i++) { $_usr[] = fread($handle, ord(fread($handle, 1))); $_tim[] = fread($handle, ord(fread($handle, 1))); $_tt[] = fread($handle, ord(fread($handle, 1))); $_num[] = fread($handle, ord(fread($handle, 1))); $l = fread($handle, 4); $_txt[] = fread($handle, $l); if ($_usr[$i + 1] == $usr && $_tt[$i + 1] == $t && $_txt[$i + 1] == $txt) $txt = NULL; } $bg = 1; fclose($handle); if ($txt != NULL) { if ($n != 0) $num = $_num[1] + 1; else $num = 1; $_usr[0] = $usr; $_tim[0] = $tim; $_tt[0] = $t; $_num[0] = $num; $_txt[0] = $txt; $n++; $bg = 0; $nn = $n; if ($nn > $max) $nn = $max; $handle = fopen($file, "w"); $l = $nn; while (strlen($l) < 6) $l = "0" . $l; fwrite($handle, $l); for ($i = 0; $i < $nn; $i++) { fwrite($handle, chr(strlen($_usr[$i])) . $_usr[$i]); fwrite($handle, chr(strlen($_tim[$i])) . $_tim[$i]); fwrite($handle, chr(strlen($_tt[$i])) . $_tt[$i]); fwrite($handle, chr(strlen($_num[$i])) . $_num[$i]); $l = strlen($_txt[$i]); while (strlen($l) < 4) $l = "0" . $l; fwrite($handle, $l . $_txt[$i]); } fclose($handle); } echo "Hozzászólás
"; if ($n > $max) $n = $max; $p = $bg + $pos; if ($n == 0) echo "Nincs hozzászólás!
\n"; else { if ($pos > 0) { $i = $pos - $block; if ($i < 0) $i = 0; echo "<<lapoz
\n"; } $i = $block; while ($p < $n + $bg && $i > 0) { echo "[" . date("m-d H:i", $_tim[$p]) . " $_num[$p].]
\n" . outputusr($_usr[$p]) . ": " . outputstr($_txt[$p]) . "
\n"; $p++; $i--; } if ($p < $n + $bg) { $i = $pos + $block; echo "lapoz>>\n"; } } echo " "; ?>