В-общем сделал вывод комментариев из блока Опросов, всё работает, но всё равно постоянно теперь пишет ошибку такую:
Цитата
Notice: Undefined index: voting Line: 23 in file /var/www/pdaki192/data/www/pda-kino.net.ru/addons/blocks/block_new_comments_on_site.php
URL: /
Date: 2010-10-09 20:54:25
IP: 92.252.139.5
Notice: Undefined index: voting Line: 23 in file /var/www/pdaki192/data/www/pda-kino.net.ru/addons/blocks/block_new_comments_on_site.php
URL: /
Date: 2010-10-09 20:55:31
IP: 213.87.86.85
Notice: Undefined index: voting Line: 23 in file /var/www/pdaki192/data/www/pda-kino.net.ru/addons/blocks/block_new_comments_on_site.php
URL: /
Date: 2010-10-09 20:55:41
IP: 92.252.139.5
Цитата
<?php
if (!defined('CMS')) die('Попытка взлома?');
$limit['comment']=6; //Кол-во выводимых комментариев
$strip['comment']=200; //Кол-во символов в выводимом комментарии
$cache='0'; //1-вкл кэш, 0-выкл кэш
if ($cache=='1' && $Mainclass->Cache->Get('block_new_comments_on_site',false)) $content .=$Mainclass->Cache->Get('block_new_comments_on_site',false);
else {
$mas['news']=$comment='';
$mass['count']['news']=$c=0;
$comments=$Mainclass->Db->Query('SELECT c.`id`, c.`mid`, c.`m_value`, c.`text`, m.`name` FROM `el_comments` AS c LEFT JOIN `el_modules` AS m ON c.`mid`=m.`id` ORDER BY `date` DESC LIMIT '.$limit['comment'].'',__file__,__line__);
while($arrcom=$Mainclass->Db->Fetch_assoc($comments)) {
$arrcom['text']=strip_tags($arrcom['text']);
if(strlen($arrcom['text'])>$strip['comment'] && $arrcom['text']!='') $arrcom['text'] = "".substr($arrcom['text'], 0, $strip['comment'])."...";
$com[$arrcom['id']]['module']=$arrcom['name'];
$com[$arrcom['id']]['id']=$arrcom['m_value'];
$com[$arrcom['id']]['text']=$arrcom['text'];
$mas[$arrcom['name']] .="".$arrcom['m_value'].",";
}
krsort($com);
foreach ($mas as $mod=>$mc) $uniq[$mod]=implode(',', array_unique(explode(',', substr($mc, 0, -1))));
foreach ($uniq as $module=>$ids) {
if ($module=='news' && $uniq['news']!='') {
$news=$Mainclass->Db->Query('SELECT `id`, `url`, `title` FROM `f_news` INNER JOIN `f_news_l` USING(`id`) WHERE `id` IN ('.$ids.') LIMIT '.$limit['comment'].'',__file__,__line__);
while($arrn=$Mainclass->Db->Fetch_assoc($news)) {foreach ($com as $cid=>$arr) {if ($arr['module']=='news' && $arrn['id']==$arr['id']) {$com[$cid]['url']='<img src="/images/com.png" alt="»" align="left" /> <a href="/news.html">Фильмы</a> - <a href="/news/'.$arrn['url'].'.html#comment_'.$cid.'" title="'.$arrn['title'].'">'.$arrn['title'].'</a> <br> '.$com[$cid]['text'].' ';}}}}
if ($module=='voting' && $uniq['voting']!='') {
$voting=$Mainclass->Db->Query('SELECT `id`, `url`, `title` FROM `f_voting` INNER JOIN `f_voting_l` USING(`id`) WHERE `id` IN ('.$ids.') LIMIT '.$limit['comment'].'',__file__,__line__);
while($arrn=$Mainclass->Db->Fetch_assoc($voting)) {foreach ($com as $cid=>$arr) {if ($arr['module']=='voting' && $arrn['id']==$arr['id']) {$com[$cid]['url']='<img src="/images/com.png" alt="»" align="left" /> <a href="/voting.html">Опросы</a> - <a href="/voting/'.$arrn['url'].'.html#comment_'.$cid.'" title="'.$arrn['title'].'">'.$arrn['title'].'</a> <br> '.$com[$cid]['text'].' ';}}}}
}
foreach ($com as $cid=>$conf) {if ($conf['text']!='') $comment .='<tr><td>'.$conf['url'].'</td></tr>';}
$content .='<span style="font-size:12pt;line-height:100%"><center>Последние комментарии к фильмам:</center></span><br />
<style>.tabst {margin:0px;}table.tabstyle td, table.tabstyle th {border: 0px #ffffff;}table.tabstyle th {background: #ffffff;color: #000000;font-size: 12px;}table.tabstyle tr.tabletrline {background-color: #ffffff;text-align:left;}</style>
<div class="tabst"><table width="100%" class="tabstyle" border="0" cellspacing="1">
'.$comment.'
</table></div><br><hr><br>';
if ($cache=='1') $Mainclass->Cache->Put('block_new_comments_on_site',$content,86400,false);
}
?>