function captcha_go($args = array()) { global $MSO; echo ' <div class="captcha"><label for="comments_captha">' . tf('Введите нижние символы') . '</label> <input type="text" name="comments_captha" id="comments_captha" value="" maxlength="4" class="comments_captha"> <img src="' . create_captha_img(mso_md5($MSO->data['session']['session_id'] . mso_current_url())) . '" alt="" title="' . tf('Защита от спама: введите только нижние символы') . '"> <span>' . t('(обязательно)') . '</span><br><br></div> '; }
function default_components() { // запоминаем результат, чтобы несколько раз не вызывать функцию mso_get_path_files static $all = false; if ($all === false) { $all = mso_get_dirs(getinfo('template_dir') . 'components/', array(), true); } return '0||' . tf('Отсутствует') . '#' . implode($all, '#'); }
function captcha_go($args = array()) { global $MSO; # сама картинка формируется в img.php # в ней мы передаем сессию, текущую страницу и время (против кэширования) echo ' <div class="captcha"><label for="comments_captha">' . tf('Введите нижние символы') . '</label> <input type="text" name="comments_captha" id="comments_captha" value="" maxlength="4" class="comments_captha"> <img src="' . getinfo('plugins_url') . 'captcha/img.php?image=' . $MSO->data['session']['session_id'] . '&page=' . mso_slug(mso_current_url()) . '&code=' . time() . '" alt="" title="' . tf('Защита от спама: введите только нижние символы') . '"> <span>' . t('(обязательно)') . '</span><br><br></div> '; }
function comment_button_custom($arg = array()) { echo '<p class="comment_button"> <button type="button" class="comment_button_b" title="' . tf('Полужирный') . '" onClick="addText(\'<b>\', \'</b>\') ">B</button> <button type="button" class="comment_button_i" title="' . tf('Курсив') . '" onClick="addText(\'<i>\', \'</i>\') ">I</button> <button type="button" class="comment_button_u" title="' . tf('Подчеркнутый') . '" onClick="addText(\'<u>\', \'</u>\') ">U</button> <button type="button" class="comment_button_s" title="' . tf('Зачеркнутый') . '" onClick="addText(\'<s>\', \'</s>\') ">S</button> <button type="button" class="comment_button_blockquote" title="' . tf('Цитата') . '" onClick="addText(\'<blockquote>\', \'</blockquote>\') ">' . t('Цитата') . '</button> <button type="button" class="comment_button_pre" title="' . tf('Код или преформатированный текст') . '" onclick="addText(\'<pre>\', \'</pre>\') ">' . t('Код') . '</button> </p>'; }
function comment_button_custom($arg = array()) { $options = mso_get_option('plugin_comment_button', 'plugins', array()); if (!isset($options['show_buttons']) or !trim($options['show_buttons'])) { $options['show_buttons'] = 'b|i|u|s|blockquote|pre'; } $buttons = array_map('trim', preg_split("/[\\s,\\|]+/", trim($options['show_buttons']))); echo '<p class="comment_button"> ' . (!in_array('b', $buttons) ? '' : ' <button type="button" class="comment_button_b" title="' . tf('Полужирный') . '" onClick="addText(\'<b>\', \'</b>\') ">B</button>') . ' ' . (!in_array('i', $buttons) ? '' : ' <button type="button" class="comment_button_i" title="' . tf('Курсив') . '" onClick="addText(\'<i>\', \'</i>\') ">I</button>') . ' ' . (!in_array('u', $buttons) ? '' : ' <button type="button" class="comment_button_u" title="' . tf('Подчеркнутый') . '" onClick="addText(\'<u>\', \'</u>\') ">U</button>') . ' ' . (!in_array('s', $buttons) ? '' : ' <button type="button" class="comment_button_s" title="' . tf('Зачеркнутый') . '" onClick="addText(\'<s>\', \'</s>\') ">S</button>') . ' ' . (!in_array('blockquote', $buttons) ? '' : ' <button type="button" class="comment_button_blockquote" title="' . tf('Цитата') . '" onClick="addText(\'<blockquote>\', \'</blockquote>\') ">' . t('Цитата') . '</button>') . ' ' . (!in_array('pre', $buttons) ? '' : ' <button type="button" class="comment_button_pre" title="' . tf('Код или преформатированный текст') . '" onclick="addText(\'<pre>\', \'</pre>\') ">' . t('Код') . '</button>') . ' ' . mso_hook('comment_button_more') . ' </p>'; }
function login_form_widget_form($num = 1) { $widget = 'login_form_widget_' . $num; // имя для формы и опций = виджет + номер // получаем опции $options = mso_get_option($widget, 'plugins', array()); if (!isset($options['header'])) { $options['header'] = ''; } if (!isset($options['after_form'])) { $options['after_form'] = ''; } if (!isset($options['registration'])) { $options['registration'] = '0'; } // вывод самой формы $CI =& get_instance(); $CI->load->helper('form'); $form = mso_widget_create_form(tf('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])), tf('Укажите заголовок виджета')); $form .= mso_widget_create_form(tf('Регистрация'), form_dropdown($widget . 'registration', array('0' => tf('Не показывать ссылку'), '1' => tf('Показывать ссылку')), $options['registration']), tf('Ссылка будет отображена рядом с кнопкой входа')); $form .= mso_widget_create_form(tf('Текст после формы'), form_input(array('name' => $widget . 'after_form', 'value' => $options['after_form'])), tf('Можно использовать HTML')); return $form; }
} /* info-top файл предыдущая - следующая запись вывод рубрик перед заголовком записи */ $np_out = ''; if (is_type('page') and $p->val('page_type_name') == 'blog') { $np = mso_next_prev_page(array('page_id' => $p->val('page_id'), 'page_categories' => $p->val('page_categories'), 'page_date_publish' => $p->val('page_date_publish'), 'use_category' => false)); if ($np['next']) { $np_out .= '<div class="b-left"><i class="i-long-arrow-left"></i> ' . $p->link(mso_page_url($np['next']['page_slug']), $np['next']['page_title']) . '</div>'; } if ($np['prev']) { $np_out .= '<div class="b-right">' . $p->link(mso_page_url($np['prev']['page_slug']), $np['prev']['page_title']) . ' <i class="i-long-arrow-right"></i></div>'; } $p->block($np_out, '<div class="next-prev-page clearfix t90">', '</div>'); } $p->format('edit', '<i class="i-edit t-gray600 hover-t-black" title="Edit page"></i>', '<div class="b-right mar10-t">', '</div>'); $p->format('title', '<h1 class="t-gray700 bor-double-b bor3px bor-gray300 pad5-b">', '</h1>', false); $p->format('date', 'j F Y г.', '<time datetime="[page_date_publish_iso]" class="i-calendar">', '</time>'); $p->format('view_count', '<span class="i-eye mar15-l">' . tf('Просмотров') . ': ', '</span>'); $p->format('comments_count', '<span class="i-comment mar15-l">Комментарии: ', '</span>'); $p->format('cat', '<i class="i-bookmark-o mar10-l"></i>', '<br><span class="i-bookmark" title="' . tf('Рубрика записи') . '">', '</span>'); $p->format('tag', '<i class="i-tag mar10-l"></i>', '<br><span class="i-tags links-no-color" title="' . tf('Метка записи') . '">', '</span>'); $p->html(NR . '<header class="mar20-b">'); $p->line('[edit][title]'); $p->div_start('info info-top t-gray600 t90'); $p->line('[date][view_count][comments_count][cat][tag]'); $p->div_end('info info-top'); $p->html('</header>'); # end file
mso_page_content($page_content); if ($f = mso_page_foreach('info-bottom')) { require $f; } // подключаем кастомный вывод mso_page_content_end(); echo '<div class="break"></div>'; mso_page_comments_link(array('page_comment_allow' => $page_comment_allow, 'page_slug' => $page_slug, 'title' => tf('Обсудить') . ' (' . $page_count_comments . ')', 'title_no_link' => tf('Читать комментарии') . ' (' . $page_count_comments . ')', 'do' => '<div class="comments-link"><span>', 'posle' => '</span></div>', 'page_count_comments' => $page_count_comments)); echo '</div>'; } echo NR . '</div></div><!--div class="page_only"-->' . NR; } } if (!$full_posts) { echo '</ul>'; } mso_hook('pagination', $pagination); } else { if ($f = mso_page_foreach('pages-not-found')) { require $f; // подключаем кастомный вывод } else { echo '<h1>' . tf('404. Ничего не найдено...') . '</h1>'; echo '<p>' . tf('Извините, ничего не найдено') . '</p>'; echo mso_hook('page_404'); } } // endif $pages echo NR . '</div><!-- class="type type_author" -->' . NR; # конечная часть шаблона require getinfo('template_dir') . 'main-end.php';
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ mso_remove_hook('body_start', 'demo_body_start'); mso_remove_hook('body_end', 'demo_body_end'); require getinfo('template_dir') . 'main-start.php'; echo NR . '<div class="type type_loginform">' . NR; echo '<div class="loginform">'; if (!is_login()) { $redirect_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : getinfo('siteurl'); if (mso_segment(2) == 'error') { echo '<p><strong style="color: red;" class="loginform">' . tf('Неверный логин/пароль') . '</strong></p>'; } echo '<p class="header">' . tf('Введите свой логин и пароль') . '</p>'; mso_login_form(array('login' => tf('Логин'), 'password' => tf('Пароль'), 'submit' => '', 'submit_value' => tf('Войти'), 'form_end' => '<div class="form-end"><a href="' . getinfo('siteurl') . '">' . tf('Вернуться к сайту') . '</a></div>'), $redirect_url); } else { echo '<p>' . tf('Привет') . ', ' . getinfo('users_nik') . '! [<a href="' . getinfo('siteurl') . 'logout' . '">' . tf('выйти') . '</a>]</p>'; // mso_redirect(); } echo '</div>'; echo NR . '</div><!-- class="type type_loginform" -->' . NR; require getinfo('template_dir') . 'main-end.php';
function mso_page_other_pages($page_id = 0, $page_categories = array()) { if ($bl_title = mso_get_option('page_other_pages', 'templates', tf('Еще записи по теме'))) { // алгоритм получения записей $algoritm = mso_get_option('page_other_pages_algoritm', 'templates', 'all'); if ($algoritm == 'lowlewel') { $all_cat = mso_cat_array_single(); // все рубрики $bl_page_categories = array(); // обработаный массив id-level foreach ($page_categories as $cat_id) { $bl_page_categories[$cat_id] = $all_cat[$cat_id]['level']; } arsort($bl_page_categories); // сортируем в обратном порядке $bl_page_categories = array_keys($bl_page_categories); // оставляем только ключи (id) // если что-то есть, то оставляем только первую рубрику, иначе $page_categories if (isset($bl_page_categories[0])) { $bl_page_categories = array($bl_page_categories[0]); } else { $bl_page_categories = $page_categories; } } else { // обычный вывод по всем рубрикам $bl_page_categories = $page_categories; } $bl_pages = mso_get_pages(array('type' => false, 'content' => false, 'pagination' => false, 'custom_type' => 'category', 'categories' => $bl_page_categories, 'exclude_page_id' => array($page_id), 'limit' => mso_get_option('page_other_pages_limit', 'templates', 7), 'order' => mso_get_option('page_other_pages_order', 'templates', 'page_date_publish'), 'order_asc' => mso_get_option('page_other_pages_order_asc', 'templates', 'random')), $_temp); if ($bl_pages) { if ($f = mso_page_foreach('page-other-pages-out')) { require $f; } else { echo '<div class="mso-page-other-pages">' . mso_get_val('page_other_pages_start', '<h4>') . $bl_title . mso_get_val('page_other_pages_end', '</h4>') . '<ul>'; foreach ($bl_pages as $bl_page) { mso_page_title($bl_page['page_slug'], $bl_page['page_title'], '<li>', '</li>', true); } echo '</ul></div>'; } } } }
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } if (!mso_hook_present('main_menu')) { ?> <div id="MainMenu" class="MainMenu"><div class="wrap"> <ul class="menu"> <?php $menu = mso_get_option('top_menu', 'templates', tf('/ | Главная_NR_about | О сайте_NR_comments | Комментарии_NR_contact | Контакты_NR_sitemap | Архив_NR_feed | RSS')); if (is_login()) { $menu .= NR . '['; $menu .= NR . 'admin | ' . getinfo('users_nik') . ' | Админ-панель | icon icon-admin'; $menu .= NR . 'admin/page_new | Создать запись'; $menu .= NR . 'admin/page | Список записей'; $menu .= NR . 'admin/cat | Рубрики'; $menu .= NR . 'admin/plugins | Плагины'; $menu .= NR . 'admin/files | Загрузки'; $menu .= NR . 'admin/sidebars | Сайдбары'; $menu .= NR . 'admin/options | Основные настройки'; $menu .= NR . 'admin/template_options | Настройка шаблона'; $menu .= NR . 'http://max-3000.com/page/faq | ЧАВО для новичков'; $menu .= NR . 'http://max-3000.com/help | Центр помощи'; $menu .= NR . 'http://forum.max-3000.com/ | Форум поддержки'; $menu .= NR . 'logout | Выход'; $menu .= NR . ']'; } elseif (is_login_comuser()) { $comuser = is_login_comuser(); $menu .= NR . '['; if ($comuser['comusers_nik']) {
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /* (c) MaxSite CMS, http://max-3000.com/ */ // условие вывода компонента // php-условие как в виджетах if ($rules = trim(mso_get_option('footer_any1_rules_output', getinfo('template'), ''))) { $rules_result = eval('return ( ' . $rules . ' ) ? 1 : 0;'); if ($rules_result === false) { $rules_result = 1; } if ($rules_result !== 1) { return; } } $opt = mso_get_option('footer_any1_block', getinfo('template'), ''); $CI =& get_instance(); $copy_maxsite = sprintf(tf('Работает на <a href="http://max-3000.com/">MaxSite CMS</a> | Время: {elapsed_time} | SQL: %s | Память: {memory_usage}'), $CI->db->query_count) . '<!--global_cache_footer--> | '; if (is_login()) { $login = '******' . getinfo('siteurl') . 'admin">' . tf('Управление') . '</a> | ' . '<a href="' . getinfo('siteurl') . 'logout">' . tf('Выйти') . '</a>'; } else { $login = '******' . getinfo('siteurl') . 'login">' . tf('Вход') . '</a>'; } // используем php-шаблонизатор eval(mso_tmpl_prepare($opt)); # end of file
// получаем результат в случае ошибки $data['password'] = $vreg_password; $data['comusers_nik'] = $vreg_nik; $data['comusers_url'] = $vreg_url; $data['email'] = $vreg_email; if (isset($post['freg_redirect_url'])) { $data['redirect'] = $post['freg_redirect_url']; } else { $data['redirect'] = getinfo('siteurl') . 'registration'; } // функция сама средиректит куда нужно // из-за этого форма ниже не будет отображена в случае успеха $res = mso_comuser_auth($data); // если ошибка, то выводим сообщение echo '<div class="mso-message-alert">' . $res . '</div>'; } } // форма регистрации $action = getinfo('siteurl') . 'registration'; if ($rules = mso_get_option('rules_site', 'general', '')) { $rules = ' (<a href="' . $rules . '" target="_blank">' . tf('Правила сайта') . '</a>)'; } else { $rules = ''; } eval(mso_tmpl_ts('type/registration/units/registration-tmpl.php')); } echo NR . '</div><!-- class="mso-type-loginform" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /* (c) MaxSite CMS, http://max-3000.com/ Вывод в подвале копирайтов и статистики. */ $pt = new Page_out(); // переделать на обычный html $pt->div('© ' . getinfo('name_site') . ', ' . date('Y'), 'copyright'); $pt->div_start('links-no-color hover-no-color'); $CI =& get_instance(); echo sprintf(tf('Работает на <a href="http://max-3000.com/">MaxSite CMS</a> | Время: {elapsed_time} | SQL: %s | Память: {memory_usage}'), $CI->db->query_count) . '<!--global_cache_footer--> | '; if (is_login()) { echo $pt->link(getinfo('siteurl') . 'admin', tf('Управление')) . ' | ' . $pt->link(getinfo('siteurl') . 'logout', tf('Выйти')); } else { echo $pt->link(getinfo('siteurl') . 'login', tf('Вход')); } $pt->div_end(''); # end file
// пройдемся по всем найденным // нужно сделать строки до вхождения и после на $max_word_count foreach ($all_key as $key) { $arr[$key] = '<span style="color: red; background: yellow;">' . str_replace($searh_to_text, '<strong>' . $searh_to_text . '</strong>', $arr[$key]) . '</span>'; $key_start = $key - $max_word_count_do; if ($key_start < 0) { $key_start = 0; } $a = array_slice($arr, $key_start, $max_word_count_posle + $max_word_count_do); // pr($a); $out .= ' <...> ' . implode(' ', $a); } $page_content = $out; $cou = count($all_key) + substr_count(mb_strtolower($page_title, 'UTF8'), $searh_to_text); // кол-во совпадений echo '<p><em>' . tf('Совпадений') . ': ' . $cou . '</em></p>'; echo '<p>' . $page_content . '</p>'; echo '</li>'; } // end foreach echo '</ul>'; mso_hook('pagination', $pagination); } if ($pages or $categories or $tags) { echo '</div></div></div>'; } if (!$pages and !$categories and !$tags) { if ($f = mso_page_foreach('pages-not-found')) { require $f; // подключаем кастомный вывод } else {
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } extract($page); mso_page_title($page_slug, $page_title, '<h1>', '</h1>', true); echo '<div class="page_content">'; echo '<div class="info">'; mso_page_date($page_date_publish, array('format' => 'D, j F Y г.', 'days' => tf('Понедельник Вторник Среда Четверг Пятница Суббота Воскресенье'), 'month' => tf('января февраля марта апреля мая июня июля августа сентября октября ноября декабря')), '<span>', '</span><br>'); mso_page_cat_link($page_categories, ' -> ', '<span>' . tf('Рубрика') . ':</span> ', '<br>'); mso_page_tag_link($page_tags, ' | ', '<span>' . tf('Метки') . ':</span> ', ''); mso_page_edit_link($page_id, 'Edit page', ' [', ']'); echo '</div>'; mso_page_content($page_content); mso_page_content_end(); echo '<div class="break"></div>'; 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 { 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">'; if ($comments) { echo '<ul>'; foreach ($comments as $comment) { if ($f = mso_page_foreach('comments')) { require $f; // подключаем кастомный вывод continue; // следующая итерация } extract($comment); echo '<li><span><a href="' . getinfo('siteurl') . 'page/' . mso_slug($page_slug) . '#comment-' . $comments_id . '" name="comment-' . $comments_id . '">' . $page_title . '</a>'; echo ' | ' . $comments_url; echo '</span><br>' . $comments_date;
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } mso_head_meta('title', tf('Комментаторы') . ' » ' . getinfo('title')); // meta title страницы
public function setMontoMensualAttribute($value) { $this->attributes['monto_mensual'] = tf($value); }
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ if (mso_get_option('category_show_rss_text', 'templates', 1)) { if ($f = mso_page_foreach('tag-show-rss-text')) { require $f; } else { echo mso_get_val('show_rss_text_start', '<p class="mso-show-rss-text">') . '<a href="' . getinfo('siteurl') . mso_segment(1) . '/' . mso_segment(2) . '/feed">' . tf('Подписаться на эту метку по RSS') . '</a>' . mso_get_val('show_rss_text_end', '</p>'); } } # end of file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ if (mso_get_option('page_404_http_not_found', 'templates', 1)) { header('HTTP/1.0 404 Not Found'); } require getinfo('template_dir') . 'main-start.php'; echo NR . '<div class="type type_page_404">' . NR; if ($f = mso_page_foreach('page_404')) { require $f; // подключаем кастомный вывод } else { echo '<div class="page_only"><div class="wrap">'; echo '<h1>' . tf('404 - несуществующая страница') . '</h1>'; echo '<div class="page_content">'; echo '<p>' . tf('Извините по вашему запросу ничего не найдено!') . '</p>'; echo mso_hook('page_404'); echo '</div></div></div>'; } echo NR . '</div><!-- class="type type_page_404" -->' . NR; require getinfo('template_dir') . 'main-end.php';
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } mso_head_meta('title', tf('Восстановление пароля') . ' » ' . getinfo('title')); // meta title страницы
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } extract($page); // pr($page); // выводим полные тексты или списком if (mso_get_option('home_full_text', 'templates', '1')) { echo NR . '<div class="page_only">' . NR; mso_page_title($page_slug, $page_title, '<h1>', '</h1>', true); echo '<div class="info">'; mso_page_date($page_date_publish, array('format' => 'D, j F Y г.', 'days' => tf('Понедельник Вторник Среда Четверг Пятница Суббота Воскресенье'), 'month' => tf('января февраля марта апреля мая июня июля августа сентября октября ноября декабря')), '<span>', '</span><br>'); mso_page_cat_link($page_categories, ' -> ', '<span>' . tf('Рубрика') . ':</span> ', '<br>'); mso_page_tag_link($page_tags, ' | ', '<span>' . tf('Метки') . ':</span> ', ''); mso_page_edit_link($page_id, 'Edit page', ' [', ']'); # mso_page_feed($page_slug, 'комментарии по RSS', '<br><span>Подписаться</span> на ', '', true); echo '</div>'; echo '<div class="page_content type_home">'; mso_page_content($page_content); mso_page_content_end(); echo '<div class="break"></div>'; mso_page_comments_link(array('page_comment_allow' => $page_comment_allow, 'page_slug' => $page_slug, 'title' => tf('Обсудить') . ' (' . $page_count_comments . ')', 'title_no_link' => tf('Читать комментарии') . ' (' . $page_count_comments . ')', 'do' => '<div class="comments-link"><span>', 'posle' => '</span></div>', 'page_count_comments' => $page_count_comments)); // mso_page_comments_link($page_comment_allow, $page_slug, 'Обсудить (' . $page_count_comments . ')', '<div class="comments-link">', '</div>'); echo '</div>'; echo NR . '</div><!--div class="page_only"-->' . NR; } else { mso_page_title($page_slug, $page_title, '<li>', '', true); mso_page_date($page_date_publish, 'd/m/Y', ' - ', ''); echo '</li>'; }
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } echo '<h3 class="category"><a href="' . getinfo('siteurl') . mso_segment(1) . '/' . mso_segment(2) . '/feed">' . tf('Подписаться на эту метку по RSS') . '</a></h3>';
echo '<div class="comments_content">' . mso_avatar($comment) . mso_comments_content($comments_content) . '</div>'; } echo '<div class="clearfix"></div>'; echo '</li>'; // pr($comment); } echo '</ol>'; echo '</div>' . NR; } if ($page_comment_allow and $page_text_ok) { // если запрещены комментарии и от анонимов и от комюзеров, то выходим if (mso_get_option('allow_comment_anonim', 'general', '1') or mso_get_option('allow_comment_comusers', 'general', '1')) { if ($f = mso_page_foreach('page-comment-form-do')) { require $f; } else { echo '<div class="break"></div>' . mso_get_val('leave_a_comment_start', '<h3 class="comments">') . mso_get_option('leave_a_comment', 'templates', tf('Оставьте комментарий!')) . mso_get_val('leave_a_comment_end', '</h3>'); } if ($f = mso_page_foreach('page-comment-form')) { require $f; // подключаем кастомный вывод } else { // форма комментариев // page-comment-form.php может быть в type своего шаблона $fn1 = getinfo('template_dir') . 'type/page-comment-form.php'; // путь в шаблоне $fn2 = getinfo('templates_dir') . 'default/type/page-comment-form.php'; // путь в default if (file_exists($fn1)) { require $fn1; } elseif (file_exists($fn2)) { require $fn2;
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } mso_head_meta('title', tf('Форма редактирования комментатора') . ' » ' . getinfo('title')); // meta title страницы
} eval(mso_tmpl_ts('type/loginform/units/loginform-user-tmpl.php')); } elseif ($comuser = is_login_comuser()) { if (mso_segment(2) == 'error') { mso_redirect('loginform'); } if (!$comuser['comusers_nik']) { $hello = t('Привет!'); } else { $hello = t('Привет,') . ' ' . $comuser['comusers_nik'] . '!'; } eval(mso_tmpl_ts('type/loginform/units/loginform-comuser-tmpl.php')); } else { $redirect_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : getinfo('siteurl'); if (mso_segment(2) == 'error') { eval(mso_tmpl_ts('type/loginform/units/loginform-error.php')); } // если разрешена регистрация, то выведем ссылку if (mso_get_option('allow_comment_comusers', 'general', '1')) { $reg = '<a href="' . getinfo('siteurl') . 'registration">' . tf('Регистрация') . '</a> | '; } else { $reg = ''; } $login_form = mso_login_form(array('login' => tf('Логин'), 'password' => tf('Пароль'), 'submit' => '', 'submit_value' => tf('Войти'), 'form_end' => '<div class="mso-loginform-end">' . $reg . '<a href="' . getinfo('siteurl') . 'password-recovery">' . tf('Забыли пароль?') . '</a> | ' . '<a href="' . getinfo('siteurl') . '">' . tf('Вернуться к сайту') . '</a></div>'), $redirect_url, false); eval(mso_tmpl_ts('type/loginform/units/loginform-tmpl.php')); } echo NR . '</div><!-- class="mso-type-loginform" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ if ($fn = mso_find_ts_file('main/main-start.php')) { require $fn; } echo '<div class="mso-type-sitemap"><div class="mso-page-only">'; echo '<header><h1 class="mso-type-sitemap">' . tf('Карта сайта (архив)') . '</h1></header>'; echo '<div class="mso-page-content mso-type-sitemap-content">'; if ($f = mso_page_foreach('sitemap')) { require $f; } else { if (function_exists('sitemap')) { echo sitemap(); } else { echo mso_hook('sitemap'); } } echo '</div></div></div><!-- mso-page-content mso-type-sitemap-content mso-page-only mso-type-sitemap -->'; if ($f = mso_page_foreach('sitemap-posle')) { require $f; } if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; }
if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ echo NR . '<div class="mso-type-home-cat-block">' . NR; if ($f = mso_page_foreach('home-cat-block-text-do')) { require $f; } // нужно считать каждую указанную рубрику и в цикле // получить для неё все данные и сразу вывести // параметры для получения страниц - общие для всех $par = array('limit' => mso_get_option('home_limit_post', 'templates', '7'), 'cut' => mso_get_option('more', 'templates', tf('Читать полностью »')), 'cat_order' => 'category_id_parent', 'cat_order_asc' => 'asc', 'pagination' => false, 'exclude_page_id' => mso_get_val('exclude_page_id')); $home_cat_block = mso_explode(mso_get_option('home_cat_id', 'templates', '0')); // в массив // все блоки можно закэшировать на 15 минут $key_home_cache = serialize($home_cat_block); if ($k = mso_get_cache($key_home_cache)) { print $k; } else { ob_start(); if ($home_cat_block) { // перебираем рубрики foreach ($home_cat_block as $cat_id) { if ($f = mso_page_foreach('home-cat-block')) { require $f; // подключаем кастомный вывод continue;
public function setCoberturaAttribute($value) { $this->attributes['cobertura'] = tf($value); }