Создать форум бесплатно: ixbb.ru :: Календарь на Апрель 2024 года: calendar2008.ru/2024/aprel/

  Reply to this topicStart new topicStart Poll

Как добавить место для базы? Чего сменить?

, Как добавить место для базы? Чего сменит
zymossis
Отправлено: Sep 11 2012, 10:52 AM
Quote Post


  Солдат
*

Группа: unior
Сообщений: 3
Пользователь №: 4363
Регистрация:
11-September 12



Как добавить место для базы? Чего сменить?
Фатальная ошибка: Разрешены памяти размером 134217728 Байт исчерпаны (попытался выделить 354 байт) в / home/p61250/www/???/class.php на линии 439 Моя база = 84,9 МБ (89 066 726 байт)
-------------------------------------
<?
/*
==================================================
===
MITGB v.1.02
-----------------------------------------------------
© Mr.M.I.T. - 2008
----------------------------------------------------
Файл: class.php
-----------------------------------------------------
Назначение: Основной Класс
==================================================
===
*/

class main {
function form() {
include "user_bbcode.php";
$gen=base64_encode(rand(1000,9999));
$form=@file_get_contents("tpl/form.tpl");
$form=str_replace("{IMG}","<img src='img.php'>",$form);
$form=str_replace("{BBCODE}",give_user_bbcode(),$form);
$exv=explode("|",$_COOKIE['user']);
$form=str_replace("{NAME}",$exv[0],$form);
$form=str_replace("{EMAIL}",$exv[1],$form);
return $form;

}
function give_msg() {
global $cnf;
$n=(filter($_GET['n'],'0-9')-1)*$cnf['num'];
$fp=file("base/base.dat");
if ($cnf['reverse_msg']==1) $fp=array_reverse($fp);
if ($n<1 || empty($n)) {
$n=0;
}
if ($n>count($fp)) {
$n=$n-count($fp);
}
if (count($fp)>=$cnf['num']){
$po=$n+$cnf['num'];
if ($po>count($fp)) {
$po=count($fp);
}
}
else {
$po=count($fp);
}
$msg="";
for ($i=$n;$i<$po;$i++) {
@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
$msg.=@file_get_contents("tpl/msg.tpl");
$msg=str_replace("{NAME}",$name,$msg);
$is=$i+1;
$msg=str_replace("{NUM}",$is,$msg);
$msg=str_replace("{DATA}",$data,$msg);
$logn=preg_replace("#@(.+)#","",$email);
$domian=preg_replace("#(.+)@#","",$email);
$msg=str_replace("{EMAIL}","<a href=\"javascript:reemail('".$logn."','".$domian."');\"><img src=img/email.gif ></a>",$msg);
if (!empty($url)) {
$msg=str_replace("{URL}","<a href=$url ><img src=img/site.gif ></a>",$msg);
}
else {
$msg=str_replace("{URL}","",$msg);
}
$msg=str_replace("{TEXT}",$text,$msg);
if (isset($_SESSION['admin'])) {
$msg=str_replace("{ADMIN}",$this->admin($id,$ip),$msg);
}
else {
$msg=str_replace("{ADMIN}","",$msg);
}
}

return $msg;
}
function admin($id,$ip) {
$bip=base64_encode($ip);
$ntime=time();
$sost=false;
$fp=file("base/ipban.dat");
for ($i=0;$i<count($fp);$i++) {
@list($banip,$rtime,$ltime,$data)=explode("<n>",$fp[$i]);
if (trim($ip)==trim($banip) && $ntime >=trim($rtime) && $ntime <= trim($ltime)){
$sost=true;
}
}
if (!$sost) {
$r= "<b>IP:$ip <a class=adm href=\"javascript://\" onclick=window.open(\"index.php?&otv=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Ответить ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?r=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Редактировать ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?del=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Удалить ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?&ban=$bip\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ БАН по IP ]</a><a class=adm href=?do=out >[ Выход ]</a></b>";
}
else {
$r= "<b>IP:$ip - Забанен <a class=adm href=\"javascript://\" onclick=window.open(\"index.php?&otv=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Ответить ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?r=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Редактировать ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?del=$id\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Удалить ]</a><a class=adm href=\"javascript://\" onclick=window.open(\"index.php?&reban=$bip\",'',& #39;toolbar=0,location=0,directories=0,status=0,me
nubar=1,scrollbars=1,resizable=0,width=600,height=
500,center=1,top=1'); >[ Разбанить ]</a><a class=adm href=?do=out >[ Выход ]</a></b>";
}
return $r;
}
function admin_mod() {
if (isset($_SESSION['admin'])) {
$r=$_GET['r'];
$otv=$_GET['otv'];
$del=$_GET['del'];
$ban=$_GET['ban'];
$reban=$_GET['reban'];
if(!empty($reban)) {
$reban=base64_decode($reban);
$fp=file("base/ipban.dat");
$op=fopen("base/ipban.dat","w");
for ($i=0;$i<count($fp);$i++) {
$fp[$i]=str_replace("\n","",$fp[$i]);
$fp[$i]=str_replace("\r","",$fp[$i]);
@list($banip,$rtime,$ltime,$data)=explode("<n>",$fp[$i]);
if (trim($banip)==trim($reban)) {
$banip="";
$rtime="";
$ltime="";
$data="";
}
if (!empty($data) && !empty($banip) && !empty($rtime) && !empty($ltime)) {
fputs($op,"$banip<n>$rtime<n>$ltime<n>$data\r\n");
}
}

fclose($op);
print "<script language=\"javascript\" type=\"text/javascript\">javascript:window.close()</script>";
}
$ex=explode("|",$_SESSION['admin']);
if (!empty($otv)) {

$fp=file("base/base.dat");
$otvet=$_POST['otv'];
if (isset($otvet) && empty($otvet)) {
die("Нужно заполнить все поля");
}
if (isset($otvet) && !empty($otvet)) {
$op=fopen("base/base.dat","w");
$otvet=replace($otvet);
for($i=0;$i<count($fp);$i++) {
$fp[$i]=str_replace("\n","",$fp[$i]);
$fp[$i]=str_replace("\r","",$fp[$i]);
@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
if ($otv==trim($id)) {
$text="$text<br>-----------------<br><i>$ex[1]:</i> $otvet";
}
fputs($op,"$name<n>$email<n>$url<n>$data<n>$text<n>$id<n>$ip\r\n");
}
fclose($op);
print "<script language=\"javascript\" type=\"text/javascript\">javascript:window.close()</script>";
}
for($i=0;$i<count($fp);$i++) {

@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
if ($otv==trim($id)) {
$text=r_replace($text);
print "
<head>
<title>Ответить</title>
<LINK href=\"style.css\" rel=stylesheet type=text/css>
</head>
<form method=POST name='form'>
<table width=\"100%\" border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
<tr>
<td valign=top width=5%></td>
<td valign=top>
<table border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=90%>
<tr bgcolor=\"#016FAE\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;\"><font face=\"tahoma\" size=\"1\"><b>
<b>Вы:</b> $ex[1]<br>
<b>$name</b> пишет:
</b>
</td>
</tr>
<tr bgcolor=\"FFFFFF\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;margin-top:2;margin-bottom:2;margin-right:2;\">
<font face=\"tahoma\" size=\"1\">$text</font><br>
-----------------------
<center>
<script language='JavaScript'>
var fombj=document.form;
</script>";
print give_user_bbcode();
print"<textarea cols=45 rows=5 name=otv onclick=\"setFieldName(this.name)\" id='otv'></textarea><br>
<input type=submit value='Ответить' class=button style='width:100px;height:18px'></center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>";
}
}
exit;
}
if (!empty($del)) {
$fp=file("base/base.dat");
$op=fopen("base/base.dat","w");
for($i=0;$i<count($fp);$i++) {
$fp[$i]=str_replace("\n","",$fp[$i]);
$fp[$i]=str_replace("\r","",$fp[$i]);
@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
if ($del==trim($id)) {
$data="";
$name="";
$text="";
$email="";
$url="";
$id="";
$ip="";
}
if (!empty($data) && !empty($name) &&
!empty($text) && !empty($email) &&
!empty($id) && !empty($ip)) {
fputs($op,"$name<n>$email<n>$url<n>$data<n>$text<n>$id<n>$ip\r\n");
}
}
fclose($op);
print "<b>Удалено</b><script language=\"javascript\" type=\"text/javascript\">javascript:window.close()</script>";
exit;
}
if (!empty($r)) {
$fp=file("base/base.dat");
$r_name=$_POST['r_name'];
$r_text=$_POST['r_text'];
$r_url=$_POST['r_url'];
$r_email=$_POST['r_email'];
if (isset($r_name) && empty($r_name) || isset($r_text) && empty($r_text) || isset($r_email) && empty($r_email)) {
die("Нужно заполнить все поля");
}
if (isset($r_name) && !empty($r_name) && isset($r_text) && !empty($r_text) && isset($r_email) && !empty($r_email)) {

$r_name=replace($r_name);
$r_text=replace($r_text);
$r_email=replace($r_email);
$r_url=replace($r_url);
$op=fopen("base/base.dat","w");
for($i=0;$i<count($fp);$i++) {
$fp[$i]=str_replace("\n","",$fp[$i]);
$fp[$i]=str_replace("\r","",$fp[$i]);
@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
if ($r==trim($id)) {
$name=$r_name;
$text=$r_text;
$email=$r_email;
$url=$r_url;
}
fputs($op,"$name<n>$email<n>$url<n>$data<n>$text<n>$id<n>$ip\r\n");
}
fclose($op);
print "<b>Отредактированно</b><script language=\"javascript\" type=\"text/javascript\">javascript:window.close()</script>";
}
for($i=0;$i<count($fp);$i++) {
@list($name,$email,$url,$data,$text,$id,$ip)=explode("<n>",$fp[$i]);
if ($r==trim($id)) {
$text=r_replace($text);
$name=r_replace($name);
$email=r_replace($email);
$url=r_replace($url);
print "
<head>
<title>Редактировать</title>
<LINK href=\"style.css\" rel=stylesheet type=text/css>
</head>
<form method=POST name='form'>
<table width=\"98%\" border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
<tr>
<td valign=top width=5%></td>
<td valign=top>
<table border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=90%>
<tr bgcolor=\"#016FAE\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;\"><font face=\"tahoma\" size=\"1\"><b>
Редактировать:
</b>
</td>
</tr>
<tr bgcolor=\"FFFFFF\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;margin-top:2;margin-bottom:2;margin-right:2;\">
<table width=100%>
<tr>
<td>
<table width=100% style='font-size:12px;'>
<tr>
<td width=10%><b>Имя:</b></td><td><input type=text name='r_name' value=$name ></td>
<tr>
<td width=10%><b>Email:</b></td><td><input type=text name='r_email' value=$email ></td>
<tr>
<td width=10%><b>URL:</b></td><td><input type=text name='r_url' value=$url ></td>
<tr>
<td width=10% valign=top ><b>Сообщение:</b></td><td>
<script language='JavaScript'>
var fombj=document.form;
</script>";
print give_user_bbcode();
print" <textarea cols=45 rows=5 name='r_text' onclick=\"setFieldName(this.name)\" id='r_text'>$text</textarea></td>
</table>

</td>
<tr>
<td align=center>
<input type=submit value='Принять' class=button style='width:100px;height:18px'>
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

";
}
}
exit;
}
}
if (!empty($ban)) {
$ban=base64_decode($ban);
$fp=file("base/ipban.dat");
for ($i=0;$i<count($fp);$i++) {
@list($banip,$rtime,$ltime,$data)=explode("<n>",$fp[$i]);
if (trim($ban)==trim($banip)){
die("Ошибка: $ban уже есть в бан листе");
}
}
$ban=trim($ban);
$time=$_POST['time'];
if (isset($time) && empty($time)) {
die("Ошибка: нужно заполнить все поля");
}
if (isset($time) && !empty($time)) {
$ntime=time();
$ltime=$time*86400+$ntime;
$data=date("d-m-y H:i:s",$ltime);
$fp=fopen("base/ipban.dat","a+");
fputs($fp,"$ban<n>$ntime<n>$ltime<n>$data\r\n");
fclose($fp);
print "<b>IP добавлен</b><script language=\"javascript\" type=\"text/javascript\">javascript:window.close()</script>";

}
print "
<head>
<title>БАН по IP</title>
<LINK href=\"style.css\" rel=stylesheet type=text/css>
</head>
<form method=POST>
<table width=\"98%\" border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
<tr>
<td valign=top width=5%></td>
<td valign=top>
<table border=\"0\" bordercolor=\"white\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=90%>
<tr bgcolor=\"#016FAE\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;\"><font face=\"tahoma\" size=\"1\"><b>
Забанить IP: $ban
</b>
</td>
</tr>
<tr bgcolor=\"FFFFFF\">
<td style=\"BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;\">
<div style=\"margin-left:2;margin-top:2;margin-bottom:2;margin-right:2;\">
<table width=100%>
<tr>
<td>
<table width=100% style='font-size:12px;'>
<tr>
<td width=15%>Забанить на: <input type=text name='time' size=5 > дней</td>
</table>

</td>
<tr>
<td align=center>
<input type=submit value='Принять' class=button style='width:100px;height:18px'>
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

";
exit;
}
}
function out() {
unset($_SESSION['admin']);
@session_destroy();
print "<html><head><META HTTP-EQUIV='Refresh' content ='0;URL=index.php'></head></html>";
}
function mod() {
$do=$_GET['do'];
if (!empty($do)) {
switch($do) {
case"out":
$this->out();
break;
case"smile":
$this->smile();
break;
}
}
}
function smile() {
$handle = opendir ('smile');
print "<table align=center border=1>
<tr>";
$num=array();
while($file = readdir ($handle)) {
if ($file == "." || $file == ".."){
continue;
}

if (substr($file,-3,3)=='gif' || substr($file,-3,3)=='jpg' || substr($file,-3,3)=='bmp') {
$num[]=$file;
}
}

foreach($num as $key=>$val){
print "
<td align=center><a href=\"javascript://\" onclick=\"Paste(':$val:')\"><img alt=$val title=$val src=\"smile/$val\"></a></td>";
$key++;
if ($key%3==0) {
print "<tr>";
}
}
print "
</table>";
closedir($handle);
exit;
}
function seegb() {
global $cnf;
$this->ip_ban();
$this->mod();
$n=filter($_GET['n'],'0-9');
$fp=file("base/base.dat");
$maxn=ceil(count($fp)/$cnf['num']);

if (empty($n) || $n>$maxn || $n<=0) {
$n=1;
}
if ($n<=2) {
$ot=1;
}
else {
$ot=$n-2;
}
if ($maxn<=$cnf['blok']) {
if ($maxn==0) {
$maxn=1;
}
$po=$maxn;
}
else{
$po=$n+$cnf['blok']-1;
if ($po>$maxn) {
$po=$maxn;
}
}

$body=@file_get_contents("tpl/main.tpl");
$page="";
for($i=$ot;$i<=$po;$i++){
if ($i==$n) {
$page.="<b>[$i]</b> ";
}
else {
$page.="<a href=index.php?n=$i>[$i]</a>";
}
}
if ($po!==$maxn) {
$page .="...";
}
$body=str_replace("{PAGE}",$page,$body);
$body=str_replace("{MSG}",$this->give_msg(),$body);
$body=str_replace("{FORM}",$this->form(),$body);
$body=str_replace("{GBNAME}",$cnf['gb_name'],$body);
$this->admin_mod();
print $body;
}
function ip_ban() {
$ip=$_SERVER["REMOTE_ADDR"];
$ntime=time();

$fp=file("base/ipban.dat");
for ($i=0;$i<count($fp);$i++) {
@list($bip,$rtime,$ltime,$data)=explode("<n>",$fp[$i]);
if ($ip==trim($bip) && $ntime >=trim($rtime) && $ntime <= trim($ltime)){
die("ВНИМАНИЕ: Вы забанены до $data ");
}
}
}
}
?>
PMEmail Poster
Top
Bard
Отправлено: Oct 15 2012, 08:03 PM
Quote Post


  Прапорщик
*

Группа: Members
Сообщений: 33
Пользователь №: 1127
Регистрация:
7-September 07



Чему равен memory_limit?
PMEmail Poster
Top
meta-trader
Отправлено: Oct 22 2012, 08:00 AM
Quote Post


  Команда ЭйсВэб
*

Группа: Super moderator
Сообщений: 1120
Пользователь №: 1194
Регистрация:
11-October 07



Для кода есть bbcode code. smile.gif
И скрипт тут не при чём.
Важен именно memory_limit.

CODE
ini_set('memory_limit', -1);
wink.gif


--------------------
Нужен форум для сайта? Создать свой форум
Нравятся ролевые игры? Создать форум для ролевой игры - создай ролевую и наслаждайся игрой!
Международный сервис фришных форумов - создать форум бесплатно.
PMEmail PosterUsers WebsiteICQ
Top

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0251 ]   [ 10 queries used ]   [ GZIP выключен ]