Почему не выводит сообщения

326
.
skynet23
Здравствуйте нашел в инете переделанный mchat для джона но вот такая проблемка не выводит сообщения помогите пожалуйста вот сам код 

<?define('_IN_JOHNCMS', 1);/**/$headmod ="mchat";$textl = 'Pikirler';$rootpath = '../';require_once ("../incfiles/core.php");require_once ("../incfiles/head.php");$us = mysql_fetch_assoc(mysql_query('select `user_id` from `m_chat` where `id` = ' . $id . ';'));switch ($act) {      case 'mass_del':   if ($rights >= 8) {   if (isset($_GET['yes'])) {   $md = $_SESSION['md'];   foreach ($md as $del_id) {   mysql_query("DELETE FROM `m_chat` WHERE `id`='" . abs(intval($del_id)) . "';");   }   echo "<div class='menu'><p>Postlar pozuldy<br/><a href='index.php'>Yza</a></p></div>";   } else {   if (empty($_POST['massdel'])) {   echo '<div class="rmenu"><p>Siz hiç zat saýlamadyňyz<br/><a href="index.php">Yza</a></p></div>';   require_once ('../incfiles/end.php');   exit;   }   foreach ($_POST['massdel'] as $v) {   $md[] = abs(intval($v));   }   $_SESSION['md'] = $md;   echo '<div class="rmenu"><p>Siz saýlan postlaryňyzy pozmakçymy?<br/><a href="index.php?act=mass_del&yes">Poz</a> | <a href="index.php">Yza</a></p></div>';   }   }else{   echo '<div class="rmenu"><p>Bu ýer Siz üçin däl!<br/><a href="index.php">Yza</a></p></div>';   require_once ('../incfiles/end.php');   }   break;   // Pikir ýazmak   case 'add':   if (isset($_POST['submit'])) {      $message = isset($_POST['message']) ? functions::checkin(mb_substr(trim($_POST['message']), 0, 100000)) : '';      // Каталог, в который мы будем принимать файл:         $uploaddir = $rootpath . '/files/pikirler/';                     if(file_exists($uploaddir.basename($_FILES['uploadfile']['name'])))                 $uploadfile = $uploaddir.'copy_'.basename($_FILES['uploadfile']['name']); else                $uploadfile = $uploaddir.basename($_FILES['uploadfile']['name']);          if (empty($message))            $error[] = 'Pikiriňizi ýazmadyňyz!';            if (isset($ban['1']) || isset($ban['13'])  || isset($ban['12']))            $error[] = 'Siz ban alanlygyňyz üçin, ýazyp bilmeýärsiňiz!';          if (!$error) {      // Копируем файл из каталога для временного хранения файлов:         if (copy($_FILES['uploadfile']['tmp_name'], $uploadfile))                       chmod($uploadfile, 0666);{                   mysql_query('INSERT INTO `m_chat` SET              `user_id` = "' . $user_id . '",              `message` = "' . mysql_real_escape_string($message) . '",                      `fayl1` = "'.basename($_FILES['uploadfile']['name']).'",    `size` = "'.basename($_FILES['uploadfile']['size']).'",  `time` = "' . time() . '";');$fadd = mysql_insert_id();            mysql_query('update `users` set `postchat` = `postchat`+1 where `id` = '.$user_id.'');$ali = explode(' ', $message); for ($i = 0; $i <= count($ali); $i++ ) {$dao = mysql_fetch_assoc(mysql_query("SELECT `name` FROM `users`;")); $notifff = mysql_fetch_assoc(                    mysql_query("                        SELECT `id` FROM `users`                         WHERE `name` = '". mysql_real_escape_string($ali[$i]) ."'                    ")                );if ($notifff) {$tema = 'Bildiriş';         $text = 'Men '.$login.'!! Sizi PIKIRLER  bölüminde agzap geçdim' . $message . 'Jogaplaýa-da Şol pikire geç';               mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$notifff['id']."',                              `text` = '".$text."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'");}}              /** fix by ДоХтор **/                if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == 'http://'. $_SERVER['SERVER_NAME'] .'/')                header('location: '. $_SERVER['HTTP_REFERER']);                else                header('location: ?');                /** ** End fix ** **/   }   }   else {            echo functions::display_error($error, '<a href="index.php">Yza</a>');         }      }   break;   //pikiri bozmak   case 'del':                   if ($us['user_id'] == $user_id || $rights >= 1) {            if (isset($_POST['submit'])) {mysql_query("UPDATE `m_chat` SET `private` = '1' WHERE `id` = '$id'");                   header('location: ?');       } else {          echo '<div class="rmenu"><form action="?act=del&id=' . $id . '" method="post">Pikiri bozmak isleýäňizmi?<br />            <input type="submit" name="submit" value="Hawa" /><br /><a href="?">Ýok</a></form></div>';            }}      break;   // Pikirleri doly arassalamak   case 'clean':   if ($rights >= 9) {      if (isset($_POST['submit'])) {         mysql_query('truncate `m_chat`');         mysql_query('optimize `m_chat`');mysql_query('truncate `m_chat1`');         mysql_query('optimize `m_chat1`');          header('location: ?');      } else {         echo '<div class="rmenu"><form action="?act=clean" method="post">Arassalaýasmy?<br />            <input type="submit" name="submit" value="Hawa" /><br /><a href="?">Ýok</a></form></div>';         }   }   break;    // Pikiri üýtgetmek   case 'edit':                   if ($user_id == $us['user_id'] || $rights >= 1) {$post = mysql_fetch_assoc(mysql_query('select `message` from `m_chat` where `id` = ' . $id . ';'));      if (isset($_POST['submit'])) {         $message = isset($_POST['message']) ? functions::checkin(mb_substr(trim($_POST['message']), 0, 100000)) : '';            if (empty($message))            $error[] = 'Pikir ýok!';            if ($ban['1'] || $ban['13'])            $error[] = 'Siz ban alanlygyňyz üçin, üýtgedip bilmeýärsiňiz!';          if (!$error) {            mysql_query('update `m_chat` set `message` = "' . mysql_real_escape_string($message) . '" where `id` = ' . $id . ';');              header('location: ?');         } else {            echo functions::display_error($error, '<a href="index.php">Yza</a>');         }      } else {         echo '<div class="phdr"><b>Pikiri üýtgetmek</b></div>';         echo '<div class="yukle"><form action="?act=edit&id=' . $id . '" name="edit" method="post">';           echo 'Pikir :<br />';           echo bbcode::auto_bb('edit', 'message');           echo '<textarea rows="' . $set_user['field_h'] . '" name="message">' . $post['message'] . '</textarea><br />' .               '<input type="submit" name="submit" value="Üýtget" /></form></div>';         echo '<div class="menu"><a href="?">Yza</a></div>';      }   } break;   // pikirlerde paylas   case 'paylas':if ($user_id) {if ($id) { $payla = mysql_fetch_array(mysql_query("SELECT * FROM `forum` WHERE `id` = '$id'"));$onpost = html_entity_decode($payla['text'],ENT_QUOTES,'UTF-8');      $user = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_id.''));$habarrr = 'Salam, Hormatly Dostluk agzalary!! Sizi  . ']' . $onpost . ' mowzugyna çagyrýaryn!!';               mysql_query('update `users` set `postchat` = `postchat`+1 where `id` = '.$user_id.'');                     mysql_query('INSERT INTO `m_chat` SET               `user_id` = "' . $user_id . '",               `message` = "' . mysql_real_escape_string($habarrr) . '",               `time` = "' . time() . '";');   $fadd = mysql_insert_id();      $tema = 'Pikirler';         $text = '[url=' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $user_id . ']'.$user['name'].'[/url] agza siziň '.$onpost.' mowzugyňyzy pikirlerde paýlaşdy.Jogaplaýa-da Şol pikire geç';         mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$payla['user_id']."',                              `text` = '".$text."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'"); header('location: /pikirler/index.php');} else {    header('location: index.php');}   } else {echo 'Diňe agza bolanlar üçin';             }            break;//Pikire jogap   case 'cyt':   $user_post = mysql_fetch_assoc(mysql_query('select * from `m_chat` where `id` = '.$id.''));   $user_cyt = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_post['user_id'].''));   echo '<div class="phdr"><b> '.$user_cyt['name'].'  agzaň pikirine jogap ýazmak</b></div>';   if (isset($_POST['submit'])) {         $message = isset($_POST['message']) ? functions::checkin(mb_substr(trim($_POST['message']), 0, 100000)) : '';      if (empty($message))            $error[] = 'Siz hiç zat ýazmadyňyz!';        if (isset($ban['1']) || isset($ban['13'])  || isset($ban['12']))            $error[] = 'Ban alanlygyňyz üçin, Siz jogap ýazyp bilmeýärsiňiz!';      if (!$error) {               mysql_query('INSERT INTO `m_chat1` SET               `user_id` = "' . $user_id . '",               `message` = "' . mysql_real_escape_string($message) . '",               `cid` = "' . $user_post['id'] . '",               `time` = "' . time() . '";'); $fadd = mysql_insert_id();                  mysql_query('update `users` set `postchat` = `postchat`+1 where `id` = '.$user_id.'');                  $user = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_id.''));   $jogaby = mysql_fetch_assoc(mysql_query('select * from `m_chat1` where `id` = '.$fadd.''));   $user98 = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_post['user_id'].''));$ali = explode(' ', $message); for ($i = 0; $i <= count($ali); $i++ ) {$user = mysql_fetch_assoc(mysql_query("SELECT `name` FROM `users`;")); $notifff = mysql_fetch_assoc(                    mysql_query("                        SELECT `id` FROM `users`                         WHERE `name` = '". mysql_real_escape_string($ali[$i]) ."'                    ")                );if ($notifff) {   $tema = 'Pikirler';         $text1 = 'Men '.$login.'!! Sizi PIKIRLER  bölüminde agzap geçdim: ' . $jogaby['message'] . ' Jogaplaýa-da Şol pikire geç';         mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$notifff['id']."',                              `text` = '".$text1."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'");} }   $tema = 'Pikirler';         $text = 'Men '.$login.'!! Siziň PIKIRLER  bölümindäki:' . $user_post['message'] . 'ýazgyňyza, şeýle jogap ýazdym: ' . $jogaby['message'] . ' Jogaplaýa-da Şol pikire geç';         mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$user_post['user_id']."',                              `text` = '".$text."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'");                   header('location: ?');      } else {         echo functions::display_error($error, '<a href="?act=cyt&id='.$id.'">Yza</a>');      }   } else {      echo '<div class="gmenu"><form action="?act=cyt&id='.$user_post['id'].'" name="form" method="post">' .          'Pikir:<br />';      echo bbcode::auto_bb('form', 'message');      echo '<div class="quote"><b>' . $user_cyt['name'] . '</b> (' . functions::display_date($user_post['time']) . ')<br />' . $user_post['message'] . '</div>';      echo '<textarea rows="' . $set_user['field_h'] . '" name="message"></textarea><br />' .          '<input type="submit" name="submit" value="Jogap" /></form></div>';      echo '<div class="menu"><a href="?">Yza</a></div>';   }   break;   //jogaba jogap   case 'jogap':   $user_post = mysql_fetch_assoc(mysql_query('select * from `m_chat1` where `id` = '.$id.''));   $user_cyt = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_post['user_id'].''));   echo '<div class="phdr"><b> '.$user_cyt['name'].' agzaň jogabyna jogap ýazmak</b></div>';   if (isset($_POST['submit'])) {         $message = isset($_POST['message']) ? functions::checkin(mb_substr(trim($_POST['message']), 0, 100000)) : '';      if (empty($message))            $error[] = 'Hiç zat ýazmadyňyz!';        if (isset($ban['1']) || isset($ban['13'])  || isset($ban['12']))            $error[] = 'Siz ban alanlygyňyz üçin, jogap ýazyp bilmeýärsiňiz!';      if (!$error) {               mysql_query('INSERT INTO `m_chat1` SET               `user_id` = "' . $user_id . '",               `message` = "' . mysql_real_escape_string($message) . '",               `cid` = "' . $user_post['cid'] . '",               `time` = "' . time() . '";'); $fadd = mysql_insert_id();               mysql_query('update `users` set `postchat` = `postchat`+1 where `id` = '.$user_id.'');                  $user = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_id.''));   $jogaby = mysql_fetch_assoc(mysql_query('select * from `m_chat1` where `id` = '.$fadd.''));   $jogaby = mysql_fetch_assoc(mysql_query('select * from `m_chat1` where `id` = '.$fadd.''));   $user98 = mysql_fetch_assoc(mysql_query('select `id`,`name` from `users` where `id` = '.$user_post['user_id'].''));$ali = explode(' ', $message); for ($i = 0; $i <= count($ali); $i++ ) {$user = mysql_fetch_assoc(mysql_query("SELECT `name` FROM `users`;")); $notifff = mysql_fetch_assoc(                    mysql_query("                        SELECT `id` FROM `users`                         WHERE `name` = '". mysql_real_escape_string($ali[$i]) ."'                    ")                );if ($notifff) {   $tema = 'Pikirler';         $text1 = 'Men '.$login.'!! Sizi PIKIRLER  bölüminde agzap geçdim: ' . $jogaby['message'] . ' Jogaplaýa-da.'] Şol pikire geç';         mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$notifff['id']."',                              `text` = '".$text1."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'");}}   $tema = 'Pikirler';         $text = 'Men '.$login.'!! Siziň PIKIRLER  bölümindäki:' . $user_post['message'] . 'jogabyňyza, şeýle jogap ýazdym: ' . $jogaby['message'] . ' Jogaplaýa-da.'] Şol pikire geç';         mysql_query("INSERT INTO `cms_mail` SET                              `user_id` = '".$user_id."',                               `from_id` = '".$user_post['user_id']."',                              `text` = '".$text."',                              `time` = '" . time() . "',                              `sys` = '1',                              `them` = '".$tema."'");                            header('location: ?');      } else {         echo functions::display_error($error, '<a href="?act=jogap&id='.$id.'">Yza</a>');      }   } else {      echo '<div class="gmenu"><form action="?act=jogap&id='.$user_post['id'].'" name="form" method="post">' .          'Jogap:<br />';      echo bbcode::auto_bb('form', 'message');      echo '<div class="quote"><b>' . $user_cyt['name'] . '</b> (' . functions::display_date($user_post['time']) . ')<br />' . $user_post['message'] . '</div>';      echo '<textarea rows="' . $set_user['field_h'] . '" name="message"> '.$user_cyt['name'].', </textarea><br />' .          '<input type="submit" name="submit" value="jogap" /></form></div>';      echo '<div class="menu"><a href="?">Yza</a></div>';   }   break;// Esasysy   default:   echo '<div class="phdr"><b>Pikirler | </b> <a href="call_friend.php">Dostuňy çagyr</a> | <a href="who_is.php">Kim bar</a></div>';$tag = mysql_query('select * from `hashtag` order by `sany` desc limit 5;');echo '<div class="yukle">';  if (mysql_num_rows($tag)) {            $i = 0;            while ($dtag = mysql_fetch_assoc($tag)) {echo '<b><big><a href="http://dostluk.ru/pikirler/hashtag.php?tag='.$dtag['tagy'].'">'.$dtag['tag'].'</a></big></b>       ';} }echo '</div>';  if ($user_id) {      echo '<div class="gmenu"><form action="?act=add" name="add" method="post" enctype="multipart/form-data" >';               echo bbcode::auto_bb('add', 'message');       echo '<textarea rows="' . $set_user['field_h'] . '" name="message"></textarea><br />          <input type="file" name="uploadfile" />';       echo '<input type="submit" name="submit" value="Paýlaş" /></form></div>';   }else{echo '<div class="menu">Diňe agza bolanlar ýazyp biler!!!</div>';}// Нашел в интернете функцию скругления размера файлаfunction formatSize($size) {   $filesizename = array("Bytes", "Kb", "Mb", "Gb", "Tb");   return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i]: '0' . $filesizename[0];}   $total = mysql_result(mysql_query('select count(*) from `m_chat`'), 0);   if ($total) {      $req = mysql_query('select * from `m_chat` order by `time` desc limit ' . $start . ', ' . $kmess . ';');     if (mysql_num_rows($req)) {            $i = 0;            while ($res = mysql_fetch_assoc($req)) {if ($res['private'] == 1) { } else {echo '<div class="p_m">';         $user = mysql_fetch_assoc(mysql_query('select * from `users` where `id` = ' . $res['user_id'] . ';'));if (file_exists((ROOTPATH . 'files/users/avatar/' . $user['id'] . '.png')))echo '<a href="' . $home . '/files/users/avatar/' . $user['id'] . '.png"><img src="' . $home . '/files/users/avatar/' . $user['id'] . '.png" width="35" height="35" alt="' . $res['user_id'] . '" style="width: 35px; height: 35px; float: left; border-radius:25px;"/></a>';elseif ($user['sex'])echo '<img src="' . $home . '/images/' . ($user['sex'] == 'm' ? 'empty-m' : 'empty-w') . '.png" width="35" height="35" alt="' . $user['user_id'] . '" style="width: 35px; height: 35px;  border-radius: 25px; float: left;" />';                                             // Dukan uchin sorag                   $colornick = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user['id']."';"));                         $colornickk = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user['id']."';"));               // dereje$v2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_votte` WHERE `kimga` = '".$user['id']."' AND `votte`='1'"),0);$v4 = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_votte` WHERE `kimga` = '".$user['id']."' AND `votte`='2'"),0);$r = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_rahmat` WHERE `kimga` = '".$user['id']."'"),0);$v5 = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mavzu` WHERE `kime` = '".$user['id']."' AND `javob`='2'"),0);$v6 = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mavzu` WHERE `kime` = '".$user['id']."' AND `javob`='1'"),0);$f=$v2+$r-$v4+$v6-$v5;$hasapp = mysql_fetch_assoc(mysql_query("SELECT * FROM `hasap` WHERE `user_id` = '".$user['id']."'"));if ($hasapp['hasap']==1){ echo '<span class= "badge-status" style="background: lightseagreen; color: gold; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 7px;">Gold</span>'; } else {     if($f>=-100 && $f<=50)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Täzeje</span>';      if($f>=51 && $f<=100)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Öwreniji</span>';     if($f>=101 && $f<=300)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Özümiziňki</span>';      if($f>=301 && $f<=500)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Gerekli</span>';     if($f>=501 && $f<=1000)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Gytyndan</span>';      if($f>=1001 && $f<=3000)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Betinden</span>';     if($f>=3001 && $f<=5000)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Hakyky dost</span>';      if($f>=5001 && $f<=10000)     echo '<span class= "badge-status" style="background: yellow; color: blue; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 5px;">Ýaşuly</span>';     if($f>=10000 && $f<=50000)     echo '<span class="brown">ViP agza</span>'; }echo  '<br>';               if ($user_id && $user_id != $res['user_id']) {echo '<span class= "badge-status" style="background: '.$user['nikfon'].'; color: silver; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 7px 0px 7px 0px;">';                        echo '<a href="../users/profile.php?user=' . $user['id'] . '"><b>'.functions::gradient('' . $user['name'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b></a></span>';                    } else {echo '<span class= "badge-status" style="background: '.$user['nikfon'].'; color: silver; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 7px 0px 7px 0px;">';                        echo '<b>'.functions::gradient('' . $user['name'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b></span> ';                    }  $sek = time() - $user ['lastdate'];if ($sek == 0){$bbb = '<font color="green"> [on]</font>';}elseif ($sek < 60){$bbb = '<font color="green ">['.$sek.'s]</font>';}else{$bbb = '<font color="red"> </font>';}echo (time() > $user['lastdate'] + 60 ? '<span class="red"></span>' : '<span class="green"> '.$bbb.'</span>');             echo ' <span class="gray">(' . functions::display_date($res['time']) . ')</span> <br>';                         if (!isset($arg['stshide']) && !empty($user['status']))echo '<span class= "badge-status" style="background: '.$user['statusfon'].'; color: silver; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 0px 7px 0px 7px;">';                echo ''.functions::image('label.png', array('class' => 'icon-inline')) .(strlen($cstat) == 1 ? '' . $user['status'] . '' : '<font color="'.$user['cstat'].'">' . $user['status'] . '</font>').'</span><p>';       $post = functions::checkout($res['message'], 1, 1);                if ($set_user['smileys'])                    $post = functions::smileys($post, $user['rights'] >= 1 ? 1 : 0);echo ''.($rights > 7 ? '<input type="checkbox" name="massdel[]" value="' . $res['id'] . '"/>': '').''.$post;   if ($res['fayl1']) {            $size = $res['size'];                echo '<div class="func">Faýl: <a href="../files/pikirler/' . $res['fayl1'] . '">' . $res['fayl1'] . '</a> <font color="darkgreen">['. formatSize($size) .']</font></div>';      } else { }if (mysql_result(mysql_query('SELECT COUNT(*) FROM `m_chat1` WHERE `cid` = '.$res['id'].';'), 0) > 0){echo '<hr>';}      $req7 = mysql_query('select * from `m_chat1`;');      while ($res7 = mysql_fetch_assoc($req7)) {if ($res7['cid'] == $res['id']) {          echo $i % 2 ? '<div class="p_m1" align="right">' : '<div class="p_m1" align="right">';         $user = mysql_fetch_assoc(mysql_query('select * from `users` where `id` = ' . $res7['user_id'] . ';'));      if (file_exists((ROOTPATH . 'files/users/avatar/' . $user['id'] . '.png')))echo '<a href="' . $home . '/files/users/avatar/' . $user['id'] . '.png"><img src="' . $home . '/files/users/avatar/' . $user['id'] . '.png" width="35" height="35" alt="' . $res7['user_id'] . '" style="width: 35px; height: 35px; border-radius: 25px; float: left;"/></a>';elseif ($user['sex'])echo '<img src="' . $home . '/images/' . ($user['sex'] == 'm' ? 'empty-m' : 'empty-w') . '.png" width="35" height="35" alt="' . $user['user_id'] . '" style="width: 35px; height: 35px; border-radius: 25px; float: left;" />';                     // dukan uchin                   $colornick = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user['id']."';"));                         $colornickk = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user['id']."';"));                              if ($user_id && $user_id != $res7['user_id']) {echo '<span class= "badge-status" style="background: '.$user['nikfon'].'; color: silver; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 7px 0px 7px 0px;">';     echo '<a href="../users/profile.php?user=' . $user['id'] . '"><b>'.functions::gradient('' . $user['name'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b></a></span>';                    } else {echo '<span class= "badge-status" style="background: '.$user['nikfon'].'; color: silver; padding: 0px 2px 0px 2px; font-weight: bold; border-radius: 7px 0px 7px 0px;">';                        echo '<b>'.functions::gradient('' . $user['name'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b></span> ';                    }$sek = time() - $user ['lastdate'];if ($sek == 0){$bbb = '<font color="green"> [on]</font>';}elseif ($sek < 60){$bbb = '<font color="green ">['.$sek.'s]</font>';}else{$bbb = '<font color="red"></font>';}echo (time() > $user['lastdate'] + 60 ? '<span class="red"></span>' : '<span class="green"> '.$bbb.'</span>');             echo ' <span class="gray">(' . functions::display_date($res7['time']) . ')</span> <br>';                if ($user_id && $user_id != $res7['user_id'])                                              echo '<a href="index.php?act=jogap&id='.$res7['id'].'" style="float: right; margin-right: 5px; margin-top: 5px;">Jogαp</a>';         echo '<p>';    $post1 = functions::checkout($res7['message'], 1, 1);                if ($set_user['smileys'])                    $post1 = functions::smileys($post1, $user['rights'] >= 1 ? 1 : 0);echo ''.($rights > 9 ? '<input type="checkbox" name="massdel[]" value="' . $res7['id'] . '"/>': '').''.$post1;echo '</div>';         $i++;} }   if ($res['user_id'] == $user_id || $rights >= 1){               echo '<div style="float: right; margin-right: 5px; margin-top: 5px;"> <a href="?act=del&id=' . $res['id'] . '">poz</a> | <a href="?act=edit&id=' . $res['id'] . '">üýt</a></div>';            }      if ($user_id)                                                    echo '<form action="?act=cyt&id='.$res['id'].'" name="form" method="post">' .          '<br />';         echo '<textarea rows="' . $set_user['field_h'] . '" name="message"></textarea><br />' .          '<input type="submit" name="submit" value="Jogap" /></form>';            echo '</div>';         $i++;      } }}      if($rights > 8){      echo '<div class="rmenu"><input type="submit" value="Saýlanan pikirleri poz "/></div>';}            echo '</form>';   } else {      echo '<div class="rmenu">Pikirler ýok!!</div>';   }      if ($total > $kmess) {         echo '<div class="topmenu">' . functions::display_pagination('index.php?', $start, $total, $kmess) . '</div>' .            '<p><form action="index.php" method="get"><input type="text" name="page" size="2"/>' .            '<input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>';        }         if ($rights >= 9) {      echo '<div class="rmenu"><a href="?act=clean">Arassala</a></div>';   }   break;}   require_once ("../incfiles/end.php");
 а вот и код базы 
DROP TABLE IF EXISTS `m_chat`;CREATE TABLE `m_chat` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `message` varchar(500) NOT NULL,  `fayl1` varchar(500) NOT NULL,  `cid` int(11) NOT NULL,  `private` int(11) NOT NULL,  `time` int(11) NOT NULL,  PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `m_chat1`;CREATE TABLE `m_chat` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `user_id` int(11) NOT NULL,  `message` varchar(500) NOT NULL,  `cid` int(11) NOT NULL,  `private` int(11) NOT NULL,  `time` int(11) NOT NULL,  PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;



я бы мог поставить оригинальный mchat но мне нужна именна это , или может кто знает как сделать форму ответа на сообщения прямо внизу поста не открывая новую страницу и так чтобы эти ответы били внизу основного поста
.
неправильно вставил код выложу сам файл помогите пожалуйста 
Прикрепленные файлы:
.
¯\_(ツ)_/¯
Какая версия джона и для какой версии модуль?
.
PaRtiZzaN, версия 6.2.2 
.
PaRtiZzaN, вот что получается когда заходишь на страницу с модом http://i.pikir.ru/pikirler/
.
¯\_(ツ)_/¯
skynet23, А можно на русском то что там написано?
.
PaRtiZzaN, да там просто написано ответить цитировать , и тд проста на турецком в основном перевели слова с мода mchat
.
Ежик_на_букву_Ё
Гlקоﮎто хоקºωий ฯєλỗßеķ
Скрипт использует градиенты ников. Соответственно если нет мода градиентов и базы к нему, то и сообщения выводиться не будут. 
А проще поглядеть лог ошибок.
Всего: 8