} else { $a_class .= ' mso-comment-anonim'; } $avatar = mso_avatar($comment, '', false, false, true); // только адрес граватарки // $comments_content = mso_comments_content($comments_content); if (!$comusers_url or !mso_get_option('allow_comment_comuser_url', 'general', 0)) { $comusers_url = ''; } eval($tmpl); // выполнение через шаблонизатор } echo '</section>'; echo '</div>' . NR; } if ($f = mso_page_foreach('page-comments-posle-list')) { require $f; } if ($page['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')) { $to_login = tf('Вы можете <a href="#LOG#">войти</a> под своим логином или <a href="#REG#"> зарегистрироваться</a> на сайте.'); $to_login = str_replace('#LOG#', getinfo('site_url') . 'login', $to_login); $to_login = str_replace('#REG#', getinfo('site_url') . 'registration', $to_login); if (mso_get_option('new_comment_anonim_moderate', 'general', '1')) { $to_moderate = mso_get_option('form_comment_anonim_moderate', 'general', tf('Комментарий будет опубликован после проверки')); } else { $to_moderate = mso_get_option('form_comment_anonim', 'general', tf('Используйте нормальные имена')); } // если запрещены комментарии от анонимов и при этом нет залогиненности, то форму при простой форме не выводим if (!mso_get_option('allow_comment_anonim', 'general', '1') and !is_login() and !is_login_comuser() and mso_get_option('form_comment_easy', 'general', '0')) {
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'); } /** * 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'); } if ($fn = mso_find_ts_file('main/main-start.php')) { require $fn; } echo NR . '<div class="mso-type-page_404">' . NR; if ($f = mso_page_foreach('page_404')) { require $f; // подключаем кастомный вывод } else { if ($fn = mso_find_ts_file('type/page_404/units/page_404.php')) { require $fn; } } echo NR . '</div><!-- class="mso-type-page_404" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
if ($fn = mso_find_ts_file('type/page/units/page-comments-other-system.php')) { require $fn; } } elseif ($fn = mso_find_ts_file('type/page/units/page-comments.php')) { require $fn; } } // end foreach } // else page_content_only } 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 if ($f = mso_page_foreach('page-posle')) { require $f; } if (!mso_get_val('page_content_only', false)) { echo NR . '</div><!-- /div.mso-type-page -->' . 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/ */ // на странице пагинации next запись не выводим if (mso_current_paged() > 1) { return; } $par = array('limit' => 1, 'cut' => mso_get_option('more', 'templates', tf('Читать полностью »')), 'cat_order' => 'category_name', 'cat_order_asc' => 'asc', 'pagination' => false, 'exclude_page_id' => mso_get_val('exclude_page_id')); // подключаем кастомный вывод, где можно изменить массив параметров $par для своих задач if ($f = mso_page_foreach('home-cat-block-last-page-mso-get-pages')) { require $f; } $pages = mso_get_pages($par, $temp); mso_set_val('container_class', 'mso-home-last-page'); mso_set_val('full_format_title_start', '<h1>'); mso_set_val('full_format_title_end', '</h1>'); if ($fn = mso_find_ts_file('type/_def_out/full/full.php')) { require $fn; } # end file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } // только тип page echo '<div class="page_content type_' . getinfo('type') . '">'; mso_page_content($page_content); if ($f = mso_page_foreach('info-bottom')) { require $f; } // подключаем кастомный вывод mso_page_content_end(); echo '<div class="break"></div>'; // связанные страницы по родителям if ($page_nav = mso_page_nav($page_id, $page_id_parent)) { echo '<div class="page_nav">' . $page_nav . '</div>'; } // блок "Еще записи этой рубрики" mso_page_other_pages($page_id, $page_categories); echo '</div>';
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; } # end file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ $par = array('page_id' => mso_get_option('home_page_id', 'templates', '0'), 'cat_id' => mso_get_option('home_cat_id', 'templates', '0'), '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', 'exclude_page_id' => mso_get_val('exclude_page_id'), 'order' => mso_get_option('home_order', 'templates', 'page_date_publish'), 'order_asc' => mso_get_option('home_order_asc', 'templates', 'desc')); // подключаем кастомный вывод, где можно изменить массив параметров $par для своих задач if ($f = mso_page_foreach('home-mso-get-pages')) { require $f; } $pages = mso_get_pages($par, $pagination); mso_set_val('container_class', 'mso-type_home home_full'); mso_set_val('full_format_title_start', '<h1>'); mso_set_val('full_format_title_end', '</h1>'); if ($fn = mso_find_ts_file('type/_def_out/full/full.php')) { require $fn; } if ($f = mso_page_foreach('home-do-pagination')) { require $f; } mso_hook('pagination', $pagination); # end of file
require = 1 type = textarea description = Ваш вопрос placeholder = О чем вы хотите написать? [/field] [/form]'; $form_def = str_replace("\r", "", $form_def); $form_def = str_replace("\n", "_NR_", $form_def); $form = mso_get_option('form_contact', 'templates', $form_def); // pr($form); if (!$form) { $form = $form_def; } // используем плагин Forms if (!function_exists('forms_content')) { require_once getinfo('plugins_dir') . 'forms/index.php'; } echo forms_content(str_replace("_NR_", "\n", $form)); echo mso_get_option('post_contact', 'templates', ''); if ($f = mso_page_foreach('contact-posle')) { require $f; } // подключаем кастомный вывод echo '</div>'; // class="page_content" echo NR . '</div></div><!-- class="mso-type-contact" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
function sitemap($arg = '') { if (mso_segment(2) == 'cat') { return sitemap_cat($arg); } global $MSO; // кэш строим по url, потому что у он меняется от пагинации $cache_key = 'sitemap' . serialize($MSO->data['uri_segment']); $k = mso_get_cache($cache_key); if ($k) { return $k; } // да есть в кэше $options = mso_get_option('plugin_sitemap', 'plugins', array()); // получаем опции if (!isset($options['limit'])) { $options['limit'] = 30; } else { $options['limit'] = (int) $options['limit']; } if ($options['limit'] < 2) { $options['limit'] = 30; } $out = ''; // параметры для получения страниц $par = array('limit' => $options['limit'], 'custom_type' => 'home', 'content' => false, 'cat_order' => 'category_id_parent', 'cat_order_asc' => 'asc'); if ($f = mso_page_foreach('sitemap-mso-get-pages')) { require $f; } $pages = mso_get_pages($par, $pagination); // получим все if ($pages) { $out .= '<div class="page_content"><div class="sitemap">' . NR . mso_hook('sitemap_do'); $out .= '<div class="sitemap-link"><a href="' . getinfo('siteurl') . 'sitemap/cat">' . tf('Группировка по рубрикам') . '</a>' . NR . '</div>'; $first = true; foreach ($pages as $page) { $date = mso_date_convert('m/Y', $page['page_date_publish']); if ($first) { $out .= '<h3>' . $date . '</h3>' . NR . '<ul>' . NR; $first = false; } elseif ($date1 != $date) { $out .= '</ul>' . NR . '<h3>' . $date . '</h3>' . NR . '<ul>' . NR; } $slug = mso_slug($page['page_slug']); $out .= '<li>' . mso_date_convert('d', $page['page_date_publish']) . ': <a href="' . getinfo('siteurl') . 'page/' . $slug . '" title="' . htmlspecialchars($page['page_title']) . '">' . htmlspecialchars($page['page_title']) . '</a>'; if ($page['page_categories']) { $out .= ' <span>(' . mso_page_cat_link($page['page_categories'], ' → ', '', '', false) . ')</span>'; } # синонимы ссылок /* . ' (' . '<a href="' . getinfo('siteurl') . $slug . '" title="slug: ' . $slug . '">slug</a>, ' . '<a href="' . getinfo('siteurl') . 'page/' . $page['page_id'] . '" title="page: ' . $page['page_id'] . '">page: ' . $page['page_id'] . '</a>, ' . '<a href="' . getinfo('siteurl') . $page['page_id'] . '" title="id: ' . $page['page_id'] . '">id: ' . $page['page_id'] . '</a>)' */ # /синонимы ссылок $out .= '</li>' . NR; $date1 = $date; } $out .= '</ul>' . NR . mso_hook('sitemap_posle') . '</div></div>' . NR; } $pagination['type'] = ''; ob_start(); mso_hook('pagination', $pagination); $out .= ob_get_contents(); ob_end_clean(); mso_add_cache($cache_key, $out); // сразу в кэш добавим return $out; }
if ($f = mso_page_foreach('gallery-out')) { require $f; } else { echo '<h1>' . trim($gal[1]) . '</h1>'; $arg = array('galother' => str_replace('%', '|', $gal[2]), 'sort' => trim($gal[3]), 'count' => (int) $gal[4], 'class' => 'gallery_page'); if (isset($gal[5])) { $arg['filter'] = $gal[5]; } echo '<p><a href="' . getinfo('site_url') . $options['slug_gallery'] . '">' . t('Все галереи') . '</a>'; echo random_gal_widget_custom($arg); } break; } } } else { if ($f = mso_page_foreach('gallery-out-all')) { require $f; } else { echo '<h1>' . t('Галереи') . '</h1>'; echo '<div class="gallery_page"><ul class="gallery_page">'; foreach ($all as $gal) { $gal = explode('|', $gal); echo '<li><a href="' . getinfo('site_url') . $options['slug_gallery'] . '/' . trim($gal[0]) . '">' . $gal[1] . '</a></li>'; } echo '</ul></div><!-- div class=gallery_page -->'; } } echo '</div><!-- /page_only -->'; } # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) {
require_once getinfo('common_dir') . 'comments.php'; $res_post = mso_comuser_lost(array('password_recovery' => true)); // обработка отправленных данных - возвращает результат if ($f = mso_page_foreach('password-recovery-head-meta')) { require $f; } else { mso_head_meta('title', tf('Восстановление пароля') . '. ' . getinfo('title')); // meta title страницы } // if (!$comuser_info and 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_password_recovery">' . NR; echo $res_post; if ($f = mso_page_foreach('password-recovery')) { require $f; // подключаем кастомный вывод } else { echo '<h1>' . tf('Восстановление пароля комментатора') . '</h1>'; echo '<p><a href="' . getinfo('siteurl') . 'users">' . tf('Список комментаторов') . '</a></p>'; echo '<form method="post" class="comusers-form fform">' . mso_form_session('f_session_id'); echo '<p>' . tf('Если у вас сохранился код активации, то вы можете сразу заполнить все поля. Если код активации утерян, то вначале введите только email и нажмите кнопку «Готово». На указанный email вы получите код активации. После этого вы можете вернуться на эту страницу и заполнить все поля.') . '</p>'; echo '<p><span class="ffirst ftitle">' . tf('Ваш email') . '</span><span><input type="text" name="f_comusers_email" value=""></span></p>'; echo '<p><span class="ffirst ftitle">' . tf('Ваш код активации') . '</span><span><input type="text" name="f_comusers_activate_key" value=""></span></p>'; echo '<p><span class="ffirst ftitle">' . tf('Новый пароль') . '</span><span><input type="text" name="f_comusers_password" value=""></span></p>'; echo '<p><span class="ffirst"></span><span><input type="submit" name="f_submit" value="' . tf('Готово') . '"></span></p></form>'; } echo NR . '</div><!-- class="type type_password_recovery" -->' . NR; # конечная часть шаблона
* MaxSite CMS * (c) http://max-3000.com/ */ # коммментарии только сторонней системы # комментарии MaxSite CMS не выводятся // если комментарии запрещены, то выходим if (!$page['page_comment_allow']) { return; } if ($page['page_status'] !== 'publish') { return; } $page_text_ok = true; // разрешить вывод текста комментария в зависимости от пароля записи if (isset($page['page_password']) and $page['page_password']) { $page_text_ok = isset($page['page_password_ok']); // нет отметки, что пароль пройден } if (!$page_text_ok) { return; } // пароль к записи неверный echo '<span><a id="comments"></a></span>'; if ($f = mso_page_foreach('page_comments_start')) { require $f; } mso_hook('page_comments_start'); if ($code = mso_get_option('comment_other_system_code', 'general', '')) { echo $code; } # end file
function mso_default_head_section($options = array()) { // ob_start(); # задел на будущее - буферизация // <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=8"><![endif]--> echo '<!DOCTYPE HTML> <html><head>' . mso_hook('head-start') . ' <meta charset="UTF-8"> <title>' . mso_head_meta('title') . '</title> <meta name="generator" content="MaxSite CMS"> <meta name="description" content="' . mso_head_meta('description') . '"> <meta name="keywords" content="' . mso_head_meta('keywords') . '"> <link rel="shortcut icon" href="' . getinfo('template_url') . 'images/favicons/' . mso_get_option('default_favicon', 'templates', 'favicon1.png') . '" type="image/x-icon"> '; if (mso_get_option('default_canonical', 'templates', 0)) { echo mso_link_rel('canonical'); } echo NT . '<!-- RSS -->' . NT . mso_rss(); if (file_exists(getinfo('template_dir') . 'custom/head-start.php')) { require getinfo('template_dir') . 'custom/head-start.php'; } echo NT . '<!-- CSS -->' . NT . '<link rel="stylesheet" href="'; if (file_exists(getinfo('template_dir') . 'css/css.php')) { echo getinfo('template_url') . 'css/css.php'; } else { if (file_exists(getinfo('template_dir') . 'css/my_style.css')) { echo getinfo('template_url') . 'css/my_style.css'; } else { if (file_exists(getinfo('template_dir') . 'css/style-all-mini.css')) { echo getinfo('template_url') . 'css/style-all-mini.css'; } elseif (file_exists(getinfo('template_dir') . 'css/style-all.css')) { echo getinfo('template_url') . 'css/style-all.css'; } else { echo getinfo('templates_url') . 'default/css/style-all-mini.css'; } } } echo '">'; // подключение var_style.css // если есть var_style.php, то используем только его if (file_exists(getinfo('template_dir') . 'css/var_style.php')) { require getinfo('template_dir') . 'css/var_style.php'; } else { $var_file = ''; if (file_exists(getinfo('template_dir') . 'css/var_style.css')) { $var_file = getinfo('template') . '/css/var_style.css'; } elseif (file_exists(getinfo('templates_dir') . 'default/css/var_style.css')) { $var_file = 'default/css/var_style.css'; } // если var_style.css нулевой длины, то не подключаем его if (filesize(getinfo('templates_dir') . $var_file)) { echo NT . '<link rel="stylesheet" href="' . getinfo('templates_url') . $var_file . '">'; } } echo NT . '<link rel="stylesheet" href="' . getinfo('template_url') . 'css/print.css" media="print">'; out_component_css(); echo NT . mso_load_jquery(); echo NT . '<!-- plugins -->' . NR; mso_hook('head'); echo NT . '<!-- /plugins -->' . NR; mso_add_file('css/add_style.css'); default_out_profiles(); if (file_exists(getinfo('template_dir') . 'custom/head.php')) { require getinfo('template_dir') . 'custom/head.php'; } if ($f = mso_page_foreach('head')) { require $f; } if (function_exists('ushka')) { echo ushka('head'); } if (file_exists(getinfo('template_dir') . 'js/my.js')) { echo ' <script src="' . getinfo('template_url') . 'js/my.js"></script>'; } if ($my_style = mso_get_option('my_style', 'templates', '')) { echo NR . '<!-- custom css-my_style -->' . NR . '<style>' . NR . $my_style . '</style>'; } mso_hook('head-end'); if (function_exists('ushka')) { echo ushka('google_analytics_top'); } /* # буферизация на будущее $head = ob_get_contents(); ob_end_clean(); echo $head; */ echo NR . '</head>'; if (!$_POST) { flush(); } }
/** * MaxSite CMS * (c) http://max-3000.com/ */ echo '<header>'; if ($f = mso_page_foreach('category-header')) { require $f; } else { echo '<h1 class="mso-category">' . htmlspecialchars(mso_get_cat_key('category_name')) . '</h1>'; } if (mso_get_option('category_show_rss_text', 'templates', 1)) { if ($f = mso_page_foreach('category-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>'); } } if ($f = mso_page_foreach('category-show-desc')) { require $f; // подключаем кастомный вывод } else { // описание рубрики if ($category_desc = mso_get_cat_key('category_desc')) { echo '<div class="mso-category-desc">' . $category_desc . '</div>'; } if (function_exists('ushka')) { echo ushka('category_' . mso_get_cat_key('category_slug')); } } echo '</header>'; # end file
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } /** * MaxSite CMS * (c) http://max-3000.com/ */ $par = array('page_id' => mso_get_option('home_page_id_top', 'templates', '0'), 'cut' => mso_get_option('more', 'templates', 'Читать полностью »'), 'cat_order' => 'category_name', 'cat_order_asc' => 'asc', 'pagination' => false, 'exclude_page_id' => mso_get_val('exclude_page_id')); // подключаем кастомный вывод, где можно изменить массив параметров $par для своих задач if ($f = mso_page_foreach('home-top-mso-get-pages')) { require $f; } $pages = mso_get_pages($par, $temp); mso_set_val('container_class', 'mso-home-top-page'); mso_set_val('full_format_title_start', '<h1>'); mso_set_val('full_format_title_end', '</h1>'); if ($fn = mso_find_ts_file('type/_def_out/full/full.php')) { require $fn; } # end file
if ($fn = mso_find_ts_file('type/tag/units/tag-list.php')) { require $fn; } } if ($f = mso_page_foreach('tag-posle-pages')) { require $f; } // подключаем кастомный вывод if (function_exists('ushka')) { echo ushka('tag-posle-pages'); } 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 if ($f = mso_page_foreach('tag-posle')) { require $f; } echo NR . '</section></div><!-- class="mso-type-tag" -->' . NR; # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end of file
if ($fn = mso_find_ts_file('type/archive/units/archive-full.php')) { require $fn; } } else { if ($fn = mso_find_ts_file('type/archive/units/archive-list.php')) { require $fn; } } if ($f = mso_page_foreach('archive-posle-pages')) { require $f; } 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 if ($f = mso_page_foreach('archive-posle')) { require $f; } echo NR . '</div><!-- class="mso-type-archive" -->' . 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 (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 ($f = mso_page_foreach('home-head-meta')) { require $f; } # начальная часть шаблона if ($fn = mso_find_ts_file('main/main-start.php')) { require $fn; } mso_set_val('exclude_page_id', array()); // исключаем вывод записей из нижних блоков // если указан текст перед всеми записями, то выводим и его if (mso_get_option('home_text_do', 'templates', '')) { if ($fn = mso_find_ts_file('type/home/units/home-text-top.php')) { require $fn; } } // top-запись if (mso_get_option('home_page_id_top', 'templates', '0')) { if ($fn = mso_find_ts_file('type/home/units/home-top-page.php')) { require $fn; } } // последняя запись
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; echo '</span><br>' . $comments_content; echo '</li>'; // pr($comment); } echo '</ul>'; }
/** * MaxSite CMS * (c) http://max-3000.com/ */ if (!$pages) { return; } $p = new Page_out(); $p->format('title', '', '', true); $p->format('date', 'j F Y', '<span><time datetime="[page_date_publish_iso]">', '</time></span>'); // исключенные записи $exclude_page_id = mso_get_val('exclude_page_id'); $line_format = mso_get_val('list_line_format', '[title] - [date]'); $p->div_start(mso_get_val('container_class')); $p->html(NR2 . '<ul class="mso-pages-list">'); foreach ($pages as $page) { if ($f = mso_page_foreach(getinfo('type') . '-list')) { require $f; // подключаем кастомный вывод continue; // следующая итерация } $p->load($page); $p->line($line_format, NR2 . '<li>', '</li>'); $exclude_page_id[] = $p->val('page_id'); } // end foreach echo NR2 . '</ul>' . NR; $p->div_end(mso_get_val('container_class')); mso_set_val('exclude_page_id', $exclude_page_id); # end file
if ($fn = mso_find_ts_file('type/author/units/author-full.php')) { require $fn; } } else { if ($fn = mso_find_ts_file('type/author/units/author-list.php')) { require $fn; } } if ($f = mso_page_foreach('author-posle-pages')) { require $f; } 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 if ($f = mso_page_foreach('author-posle')) { require $f; } echo NR . '</div><!-- class="mso-type-author" -->' . NR; # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end of file
} } if ($f = mso_page_foreach('category-posle-pages')) { require $f; } // подключаем кастомный вывод if (function_exists('ushka')) { echo ushka('category-posle-pages'); } 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 if ($f = mso_page_foreach('category-posle')) { require $f; } // подключаем кастомный вывод echo NR . '</section></div><!-- /div.mso-type-category -->' . NR; # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
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>'; } } } }
echo $p->img($image_for_page, mso_get_option('image_for_page_css_class', 'templates', 'image_for_page'), '', $p->val('page_title')); } } } $p->content('', ''); // $p->clearfix(); } // для page возможен свой info-bottom if ($f = mso_page_foreach('info-bottom-' . getinfo('type'))) { require $f; } elseif ($f = mso_page_foreach('info-bottom')) { require $f; } $p->html('<aside>'); mso_page_content_end(); $p->clearfix(); $p->line('[comments]'); $p->html('</aside>'); $p->div_end('mso-page-content mso-type-' . getinfo('type') . '-content'); } } $p->div_end('mso-page-only', '</article>'); if ($f = mso_page_foreach(getinfo('type') . '-page-only-end')) { require $f; } $exclude_page_id[] = $p->val('page_id'); } // end foreach $p->div_end(mso_get_val('container_class')); mso_set_val('exclude_page_id', $exclude_page_id); # 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';
function my_default_head_section() { global $page; echo '<!DOCTYPE HTML> <html' . mso_get_val('head_section_html_add') . '><head>' . mso_hook('head_start') . ' <meta charset="UTF-8"> <title>' . mso_head_meta('title') . '</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="MaxSite CMS"> <meta name="description" content="' . mso_head_meta('description') . '"> <meta name="keywords" content="' . mso_head_meta('keywords') . '"> <meta property="og:title" content="' . mso_head_meta('title') . '"> <meta property="og:description" content="' . mso_head_meta('description') . '"> <meta property="og:url" content="' . mso_link_rel('canonical', '', true) . '"> <link rel="shortcut icon" href="' . getinfo('template_url') . 'assets/images/favicons/' . mso_get_option('default_favicon', 'templates', 'favicon1.png') . '" type="image/x-icon"> '; if (is_type('page') and isset($page['page_meta']['image_for_page'][0])) { echo '<meta property="og:image" content="' . $page['page_meta']['image_for_page'][0] . '">'; } if (mso_get_option('default_canonical', 'templates', 0)) { echo mso_link_rel('canonical'); } echo mso_rss(); if ($fn = mso_fe('custom/head-start.php')) { require $fn; } // autoload файлов if ($autoload_css = mso_get_path_files(getinfo('template_dir') . 'assets/css/', getinfo('template_url') . 'assets/css/', true, array('css'))) { foreach ($autoload_css as $fn_css) { echo '<link rel="stylesheet" href="' . $fn_css . '">' . NR; } } my_out_component_css(); mso_hook('head_css'); my_default_out_profiles(); // своя версия jQuery, если нужно if ($j = mso_get_val('jquery_url', false)) { echo '<script src="' . $j . '"></script>' . NR; } else { if (mso_fe('assets/js/jquery.min.js')) { echo mso_add_file('assets/js/jquery.min.js'); } else { echo mso_load_jquery(); } } mso_hook('head'); // autoload js-файлов if ($autoload_js = mso_get_path_files(getinfo('template_dir') . 'assets/js/autoload/', getinfo('template_url') . 'assets/js/autoload/', true, array('js'))) { foreach ($autoload_js as $fn_js) { echo '<script src="' . $fn_js . '"></script>' . NR; } } if ($fn = mso_fe('custom/head.php')) { require $fn; } if ($fn = mso_page_foreach('head')) { require $fn; } if (function_exists('ushka')) { echo ushka('head'); } if (mso_fe('assets/js/my.js')) { echo mso_add_file('assets/js/my.js'); } if ($my_style = mso_get_option('my_style', 'templates', '')) { echo NR . '<!-- custom css-my_style -->' . NR . '<style>' . NR . $my_style . '</style>'; } mso_hook('head_end'); if (function_exists('ushka')) { echo ushka('google_analytics_top'); } echo NR . '</head>'; }
$cat_info = mso_get_cat_from_id($cat_id); // все данные рубрики // название рубрики и ссылка echo '<div class="mso-header-home-cat">' . '<a href="' . getinfo('site_url') . 'category/' . $cat_info['category_slug'] . '">' . htmlspecialchars($cat_info['category_name']) . '</a>' . '</div>'; // выводить описание рубрики if (mso_get_option('default_description_home_cat', 'templates', '0') and $cat_info['category_desc']) { echo '<div class="mso-description-cat">' . $cat_info['category_desc'] . '</div>'; } if ($f = mso_page_foreach('home-cat-block-out-pages-do')) { require $f; } mso_set_val('container_class', 'mso-type-home mso-type-home-cat-block mso-type-home-cat-block-list'); if (mso_get_option('default_description_home', 'templates', '0')) { mso_set_val('list_line_format', '[title] - [date] [meta_description]'); } if ($fn = mso_find_ts_file('type/_def_out/list/list.php')) { require $fn; } } // endif $pages } // end foreach $home_cat_block } mso_add_cache($key_home_cache, ob_get_flush(), 900); } // if $k if ($f = mso_page_foreach('home-cat-block-posle')) { require $f; } echo NR . '</div><!-- class="mso-type-home-cat-block" -->' . NR; # end file
mso_page_title($page_slug, $page_title, '<li>', '', true); mso_page_date($page_date_publish, 'd/m/Y', ' - ', ''); echo '</li>'; } } if (!mso_get_option('home_full_text', 'templates', '1')) { echo '</ul><!--ul class="category"-->'; } else { echo '</div><!--div class="page_all"-->' . NR; } if ($f = mso_page_foreach('home-do-pagination')) { require $f; } 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 if ($f = mso_page_foreach('home-posle')) { require $f; } echo NR . '</div><!-- class="type type_home" -->' . NR; # конечная часть шаблона require getinfo('template_dir') . 'main-end.php';