function last_comments_widget($num = 1) { $widget = 'last_comments_widget_' . $num; // имя для опций = виджет + номер $options = mso_get_option($widget, 'plugins', array()); // получаем опции // заменим заголовок, чтобы был в h2 class="box" if (isset($options['header']) and $options['header']) { $options['header'] = mso_get_val('widget_header_start', '<div class="mso-widget-header"><span>') . $options['header'] . mso_get_val('widget_header_end', '</span></div>'); } else { $options['header'] = ''; } return last_comments_widget_custom($options, $num); }
if ($f = mso_page_foreach('comments-head-meta')) { require $f; } else { mso_head_meta('title', tf('Последние комментарии') . '. ' . getinfo('title')); // meta title страницы } require getinfo('template_dir') . 'main-start.php'; echo NR . '<div class="type type_comments">' . NR; if ($f = mso_page_foreach('comments-do-last-comments-widget')) { require $f; } else { echo '<h1 class="comments">' . tf('Последние комментарии') . '</h1>'; echo '<p class="info"><a href="' . getinfo('siteurl') . 'comments/feed">' . tf('Подписаться по RSS') . '</a>'; echo '<br><a href="' . getinfo('siteurl') . 'users">' . tf('Список комментаторов') . '</a></p>'; echo '<div class="comments">'; echo last_comments_widget_custom(array('count' => 40), '999'); echo '</div>'; } } else { // нет функции last_comments_widget_custom - выводим комменты как обычно require_once getinfo('common_dir') . 'comments.php'; // функции комментариев // получаем список комментариев текущей страницы $comments = mso_get_comments(false, array('limit' => mso_get_option('comments_count', 'templates', '10'), 'order' => 'desc')); mso_head_meta('title', tf('Последние комментарии') . ' — ' . getinfo('title')); // meta title страницы require getinfo('template_dir') . 'main-start.php'; echo NR . '<div class="type type_comments">' . NR; if ($f = mso_page_foreach('comments-do')) { require $f; } else {