Example #1
0
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>';
}
Example #2
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('main-start');
}
if ($fn = mso_fe('custom/main-start.php')) {
    require $fn;
}
# end of file
Example #3
0
    echo ushka('header-start');
}
if ($fn = mso_fe('custom/header-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/header_components.php')) {
    require $fn;
} else {
    if ($fn = my_get_component_fn('header_component1', 'top1')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component2')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component3')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component4')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('header_component5')) {
        require $fn;
    }
}
if (function_exists('ushka')) {
    echo ushka('header-end');
}
if ($fn = mso_fe('custom/header-end.php')) {
    require $fn;
}
# end of file
Example #4
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('header-out');
}
# end of file
Example #5
0
function ushki_content_callback($matches)
{
    if (isset($matches[1])) {
        return ushka($matches[1]);
    } else {
        return '';
    }
}
Example #6
0
function ushki_to_hook_custom($args = array())
{
    // если плагин ушек не включен, то выходим
    if (!function_exists('ushka')) {
        return $args;
    }
    $options = mso_get_option('plugin_ushki_to_hook', 'plugins', array());
    if (isset($options['option1']) and $options['option1']) {
        // mso_hook_add('хук', 'функция', приоритет);
        // content_end | page_bottom | 20
        // ushka($name_ushka = '', $delim_ushka = '<br>', $not_exists_ushka = '')
        // разобъем построчкно в массив
        $lines = explode("\n", $options['option1']);
        // рассматриваем каждую строчку
        foreach ($lines as $line) {
            // если линия пустая, то пропускаем
            if (!trim($line)) {
                continue;
            }
            // разобъем строчку на части
            $ar = explode("|", $line);
            // раскидываем значения
            $hook = (isset($ar[0]) and trim($ar[0])) ? trim($ar[0]) : false;
            // хук
            $ushka = (isset($ar[1]) and trim($ar[1])) ? trim($ar[1]) : false;
            // ушка
            $prior = (isset($ar[2]) and trim($ar[2])) ? (int) trim($ar[2]) : false;
            // приоритет хука
            //	$echo_return = (isset($ar[3]) and trim($ar[3])) ? trim($ar[3]) : ''; // как выводить по return или echo
            //	if ($echo_return != 'return' and $echo_return != 'echo' ) $echo_return = 'echo';
            if ($hook and $ushka) {
                // создадим функцию для хука
                $fn = '_ushki_to_hook_' . $hook . '_' . $ushka;
                // если её еще не создали
                if (!function_exists($fn)) {
                    //формируем текст функции
                    $tf = ' function ' . $fn . '($args = ""){ ' . NR . ushka($ushka) . NR . ' } ';
                    // выполним
                    eval($tf);
                }
                // и регистрируем в хуке
                if ($prior) {
                    mso_hook_add($hook, $fn, $prior);
                } else {
                    mso_hook_add($hook, $fn);
                }
                // приоритет не указан
            }
        }
    }
}
Example #7
0
    // цикл вывода в отдельных юнитах
    if ($full_posts) {
        if ($fn = mso_find_ts_file('type/tag/units/tag-full.php')) {
            require $fn;
        }
    } else {
        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;
}
	PHP-связи: 
			>	if ($fn = mso_fe('components/logo-ns-descr-banner/logo-ns-descr-banner.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// если в опции явно указан адрес лого, то берем его
$logo = trim(mso_get_option('default_header_logo_custom', 'templates', false));
if (!$logo) {
    $logo = getinfo('stylesheet_url') . 'images/logos/' . mso_get_option('default_header_logo', 'templates', 'logo01.png');
}
$logo = '<img src="' . $logo . '" alt="' . getinfo('name_site') . '" title="' . getinfo('name_site') . '">';
if (!is_type('home')) {
    $logo = $pt->link(getinfo('siteurl'), $logo);
}
// вывод
$pt->div_start('logo-ns-descr-banner', 'wrap');
$pt->div_start('r1');
$pt->html($logo);
$pt->div_end('r1');
$pt->div_start('r2');
$pt->div($pt->name_site(), 'name_site');
$pt->div(getinfo('description_site'), 'description_site');
$pt->div_end('r2');
$pt->div_start('r3');
if (function_exists('ushka')) {
    echo ushka('logo-banner');
}
$pt->div_end('r3');
$pt->clearfix();
$pt->div_end('logo-ns-descr-banner', 'wrap');
# end file
Example #9
0
}
if ($fn = mso_find_ts_file('main/main-start.php')) {
    require $fn;
}
echo NR . '<div class="mso-type-archive">' . NR;
if ($f = mso_page_foreach('archive-do')) {
    require $f;
} else {
    echo '<h1 class="mso-archive">' . tf('Архивы') . '</h1>';
}
if ($pages) {
    if ($fn = mso_find_ts_file('type/archive/units/archive-do-pages.php')) {
        require $fn;
    }
    if (function_exists('ushka')) {
        echo ushka('archive-do-pages');
    }
    // цикл вывода в отдельных юнитах
    if ($full_posts) {
        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);
Example #10
0
    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();
        }
    }
Example #11
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// if ($fn = mso_fe('custom/sidebars.php')) require($fn);
if (function_exists('ushka')) {
    echo ushka('main-end');
}
if ($fn = mso_fe('custom/main-end.php')) {
    require $fn;
}
# end of file
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<link rel="stylesheet" href="' . getinfo('template_url') . $css_file_template_path . $css_mod_date . '">

<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
';
// cтили заданные в админке
if ($my_style = mso_get_option('my_style', 'templates', '')) {
    echo NR . '<style>' . NR . $my_style . NR . '</style>' . NR;
}
echo NT . mso_rss();
mso_hook('head-end');
if (function_exists('ushka')) {
    echo ushka('google_analytics_top');
}
if (function_exists('ushka')) {
    echo ushka('head');
}
echo NR . '</head>' . NR;
if (!$_POST) {
    flush();
}
?>

<body class="<?php 
echo mso_get_val('body_class');
?>
">

<?php 
echo mso_hook('body_start');
?>
Example #13
0
 * (c) http://max-3000.com/
 *
 * HTML-структура шаблона
 *
 */
if ($fn = mso_fe('main/blocks/_start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/head-section.php')) {
    require $fn;
} else {
    my_default_head_section();
}
// подключение через функцию
echo '<body' . (mso_get_val('body_class') ? ' class="' . mso_get_val('body_class') . '"' : '') . '>';
global $CONTENT_OUT;
echo $CONTENT_OUT;
if (function_exists('ushka')) {
    echo ushka('google_analytics');
}
// lazy-загрузка js-файлов
if ($lazy_js = mso_get_path_files(getinfo('template_dir') . 'assets/js/lazy/', getinfo('template_url') . 'assets/js/lazy/', true, array('js'))) {
    foreach ($lazy_js as $fn_js) {
        echo '<script src="' . $fn_js . '"></script>' . NR;
    }
}
?>
</body></html><?php 
if ($fn = mso_fe('main/blocks/_end.php')) {
    require $fn;
}
Example #14
0
    echo ushka('footer-start');
}
if ($fn = mso_fe('custom/footer-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/footer_components.php')) {
    require $fn;
} else {
    if ($fn = my_get_component_fn('footer_component1', 'footer-copy-stat')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component2')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component3')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component4')) {
        require $fn;
    }
    if ($fn = my_get_component_fn('footer_component5')) {
        require $fn;
    }
}
if (function_exists('ushka')) {
    echo ushka('footer-end');
}
if ($fn = mso_fe('custom/footer-end.php')) {
    require $fn;
}
# end of file
Example #15
0
/**
 * 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
Example #16
0
function forms_show_form($options, $files, $fields, $format)
{
    $out = '';
    if (!$fields) {
        return '';
    }
    // нет полей — выходим
    // удаляем временные файлы вложений перед отображением формы
    if ($files) {
        mso_flush_cache(false, 'forms_attaches/');
    }
    // pr($fields);
    // начальная часть всегда однакова ???
    $out .= '<div class="' . $format['container_class'] . '"><form method="post" enctype="multipart/form-data">' . mso_form_session('forms_session');
    foreach ($fields as $key => $field) {
        $field = array_map('trim', $field);
        // pr($field);
        // ключ для каждого отправляемого поля
        $field_name = 'forms_fields[' . $key . ']';
        $description = $field['description'];
        // название поля
        // подсказка в поле
        $placeholder = $field['placeholder'] ? ' placeholder="' . htmlspecialchars($field['placeholder']) . '"' : '';
        // обязательные поля
        if ($field['require']) {
            // подсказка что это обязательное поле
            $require_title = ' ' . $options['require_title'];
            // если поле обязательное ставим ему required
            $required = ' required';
        } else {
            $require_title = '';
            $required = '';
        }
        // подсказка после поля
        $tip = $field['tip'] ? str_replace('[tip]', $field['tip'], $format['tip']) : '';
        $attr = $field['attr'] ? ' ' . $field['attr'] : '';
        // атрибуты поля
        $value = htmlspecialchars($field['value']);
        // значение value по-умолчанию
        // если был POST, то ставим его (он уже обработан)
        if (isset($field['post_value'])) {
            $value = $field['post_value'];
        }
        if ($field['type'] == 'textarea') {
            // комбинируем name + placeholder + $required + $attr
            $field_param = 'name="' . $field_name . '" ' . $placeholder . $required . $attr;
            $out .= str_replace(array('[description]', '[require_title]', '[field_param]', '[value]', '[tip]'), array($description, $require_title, $field_param, $value, $tip), $format['textarea']);
        } elseif ($field['type'] == 'checkbox') {
            // дефолтное значение 0 или 1
            $checked = $field['default'] ? ' checked="checked"' : '';
            $field_param = 'name="' . $field_name . '" ' . $attr . $checked;
            // cкрытый input для того, чтобы передать неотмеченный чекбокс будет - value="0"
            $out .= '<input name="' . $field_name . '" value="0" type="hidden">';
            $out .= str_replace(array('[description]', '[field_param]', '[tip]'), array($description, $field_param, $tip), $format['checkbox']);
        } elseif ($field['type'] == 'select') {
            if (!($values = $field['values'])) {
                continue;
            }
            // не указаны значение
            $default = $field['default'];
            // дефолтное значение
            $values = explode('#', $values);
            $option = '';
            foreach ($values as $o) {
                $selected = $o == $default ? ' selected="selected"' : '';
                $option .= '<option' . $selected . '>' . htmlspecialchars(tf($o)) . '</option>';
            }
            $field_param = 'name="' . $field_name . '" ' . $attr;
            $out .= str_replace(array('[description]', '[require_title]', '[field_param]', '[option]', '[tip]'), array($description, $require_title, $field_param, $option, $tip), $format['select']);
        } else {
            // комбинируем name + placeholder + $required + $attr
            $field_param = 'name="' . $field_name . '" value="' . $value . '" type="' . $field['type'] . '"' . $placeholder . $required . $attr;
            $out .= str_replace(array('[description]', '[require_title]', '[field_param]', '[tip]'), array($description, $require_title, $field_param, $tip), $format['input']);
        }
    }
    // поля для $files вывести
    if ($files) {
        $out .= forms_files_fields($files, $format);
    }
    // антиспам
    if ($options['antispam']) {
        $antispam = $options['antispam'];
        $antispam_ok = $options['antispam_ok'];
        $require_title = ' ' . $options['require_title'];
        $input = '<input type="text" name="forms_fields[antispam]" required>';
        $out .= str_replace(array('[antispam]', '[antispam_ok]', '[input]', '[require_title]'), array($antispam, $antispam_ok, $input, $require_title), $format['antispam']);
    }
    $submit = '<button type="submit">' . tf('Отправить') . '</button>';
    if (!$options['reset']) {
        $reset = '';
    } else {
        $reset = '<button type="reset">' . tf('Очистить форму') . '</button>';
    }
    $out .= str_replace(array('[submit]', '[reset]'), array($submit, $reset), $format['buttons']);
    if (function_exists('ushka') and $options['ushka']) {
        $out .= ushka($options['ushka']);
    }
    // конец формы
    $out .= '</form></div>';
    return $out;
}
Example #17
0
function forms_show_form($f = array(), $ushka = '', $forms_subscribe = true, $reset = true, $subject = '')
{
    $out = '';
    $antispam1 = rand(1, 10);
    $antispam2 = rand(1, 10);
    $id = 1;
    // счетчик для id label
    if ($subject) {
        // поле тема письма делаем в виде обязательнного поля select.
        // формируем массив для формы
        $subject_f['require'] = 1;
        // если в  subject есть #, то это несколько значений - select
        // если нет, значит обычное текстовое поле
        $subject_f['type'] = mb_strpos($subject, '#') === false ? 'text' : 'select';
        // если это одиночное поле, но при этом текст сабжа начинается
        // с _ то ставим тип hidden
        if ($subject_f['type'] == 'text' and mb_strpos($subject, '_') === 0) {
            $subject = mb_substr($subject . ' ', 1, -1, 'UTF-8');
            $subject_f['type'] = 'hidden';
        }
        $subject_f['description'] = tf('Тема письма');
        //$subject_f['tip'] = t('Выберите тему письма');
        $subject_f['values'] = $subject;
        $subject_f['value'] = $subject;
        $subject_f['default'] = '';
        // pr($subject_f);
        // преобразования, чтобы сделать ключ для поля
        $f1['subject'] = $subject_f;
        // у поля тема будет ключ subject
        //pr($f1);
        foreach ($f as $key => $val) {
            $f1[$key] = $val;
        }
        $f = $f1;
        //pr($f1);
    }
    $out .= NR . '<div class="forms"><form method="post" class="plugin_forms fform">' . mso_form_session('forms_session');
    $out .= '<input type="hidden" name="forms_antispam1" value="' . $antispam1 * 984 . '">';
    $out .= '<input type="hidden" name="forms_antispam2" value="' . $antispam2 * 765 . '">';
    // обязательные поля
    $out .= '<p><label class="ffirst ftitle" title="' . tf('Обязательное поле') . '" for="id-' . ++$id . '">' . tf('Ваше имя*') . '</label><span><input name="forms_name" type="text" value="" placeholder="' . tf('Ваше имя') . '" required id="id-' . $id . '"></span></p>';
    $out .= '<p><label class="ffirst ftitle" title="' . tf('Обязательное поле') . '" for="id-' . ++$id . '">' . tf('Ваш email*') . '</label><span><input name="forms_email" type="email" value="" placeholder="' . tf('Ваш email') . '" required id="id-' . $id . '"></span></p>';
    // тут указанные поля в $f
    // pr($f);
    foreach ($f as $key => $val) {
        if (!isset($val['type'])) {
            continue;
        }
        if (!isset($val['description'])) {
            $val['description'] = '';
        }
        $val['type'] = trim($val['type']);
        $val['description'] = trim($val['description']);
        if (isset($val['require']) and trim($val['require']) == 1) {
            $require = '*';
            $require_title = ' title="' . tf('Обязательное поле') . '"';
            $required = ' required';
        } else {
            $require = '';
            $require_title = '';
            $required = '';
        }
        if (isset($val['attr']) and trim($val['attr'])) {
            $attr = ' ' . trim($val['attr']);
        } else {
            $attr = '';
        }
        if (isset($val['value']) and trim($val['value'])) {
            $pole_value = htmlspecialchars(tf(trim($val['value'])));
        } else {
            $pole_value = '';
        }
        if (isset($val['placeholder']) and trim($val['placeholder'])) {
            $placeholder = ' placeholder="' . htmlspecialchars(tf(trim($val['placeholder']))) . '"';
        } else {
            $placeholder = '';
        }
        $description = t(trim($val['description']));
        if (isset($val['tip']) and trim($val['tip'])) {
            $tip = NR . '<p class="nop"><span class="ffirst"></span><span class="fhint">' . trim($val['tip']) . '</span></p>';
        } else {
            $tip = '';
        }
        if ($val['type'] == 'text') {
            //type_text - type для input HTML5
            if (isset($val['type_text']) and trim($val['type_text'])) {
                $type_text = htmlspecialchars(trim($val['type_text']));
            } else {
                $type_text = 'text';
            }
            $out .= NR . '<p><label class="ffirst ftitle" for="id-' . ++$id . '"' . $require_title . '>' . $description . $require . '</label><span><input name="forms_fields[' . $key . ']" type="' . $type_text . '" value="' . $pole_value . '" id="id-' . $id . '"' . $placeholder . $required . $attr . '></span></p>' . $tip;
        } elseif ($val['type'] == 'select') {
            if (!isset($val['default'])) {
                continue;
            }
            if (!isset($val['values'])) {
                continue;
            }
            $out .= NR . '<p><label class="ffirst ftitle" for="id-' . ++$id . '"' . $require_title . '>' . $description . $require . '</label><span><select name="forms_fields[' . $key . ']" id="id-' . $id . '"' . $attr . '>';
            $default = trim($val['default']);
            $values = explode('#', $val['values']);
            foreach ($values as $value) {
                $value = trim($value);
                if (!$value) {
                    continue;
                }
                // пустые опции не выводим
                if ($value == $default) {
                    $checked = ' selected="selected"';
                } else {
                    $checked = '';
                }
                $out .= '<option' . $checked . '>' . htmlspecialchars(tf($value)) . '</option>';
            }
            $out .= '</select></span></p>' . $tip;
        } elseif ($val['type'] == 'textarea') {
            $out .= NR . '<p><label class="ffirst ftitle ftop" for="id-' . ++$id . '"' . $require_title . '>' . $description . $require . '</label><span><textarea name="forms_fields[' . $key . ']" id="id-' . $id . '"' . $placeholder . $required . $attr . '>' . $pole_value . '</textarea></span></p>' . $tip;
        } elseif ($val['type'] == 'hidden') {
            $out .= NR . '<input name="forms_fields[' . $key . ']" type="hidden" value="' . $pole_value . '" id="id-' . $id . '"' . $attr . '>';
        }
    }
    // обязательные поля антиспама и отправка и ресет
    $out .= NR . '<p><label class="ffirst ftitle" for="id-' . ++$id . '">' . $antispam1 . ' + ' . $antispam2 . ' =</label>';
    $out .= '<span><input name="forms_antispam" type="text" required maxlength="3" value="" placeholder="' . tf('Укажите свой ответ') . '" id="id-' . $id . '"></span><p>';
    if ($forms_subscribe) {
        $out .= NR . '<p><span class="ffirst"></span><label><input name="forms_subscribe" value="" type="checkbox"  class="forms_checkbox"> ' . tf('Отправить копию письма на ваш e-mail') . '</label></p>';
    }
    $out .= NR . '<p><span class="ffirst"></span><span class="submit"><button name="forms_submit" type="submit" class="forms_submit">' . tf('Отправить') . '</button>';
    if ($reset) {
        $out .= ' <button name="forms_clear" type="reset" class="forms_reset">' . tf('Очистить форму') . '</button>';
    }
    $out .= '</span></p>';
    if (function_exists('ushka')) {
        $out .= ushka($ushka);
    }
    $out .= '</form></div>' . NR;
    return $out;
}
Example #18
0
                     continue;
                 }
             }
             if (trim($UNIT['file'])) {
                 // в подключаемом файле доступна переменная $UNIT — массив параметров
                 if ($fn = mso_find_ts_file('type/home/units/' . trim($UNIT['file']))) {
                     require $fn;
                 }
             } elseif (isset($UNIT['html']) and trim($UNIT['html'])) {
                 echo trim($UNIT['html']);
             } elseif (isset($UNIT['require']) and trim($UNIT['require'])) {
                 if ($fn = mso_fe(trim($UNIT['require']))) {
                     require $fn;
                 }
             } elseif (isset($UNIT['ushka']) and trim($UNIT['ushka']) and function_exists('ushka')) {
                 echo ushka(trim($UNIT['ushka']));
             } elseif (isset($UNIT['component']) and trim($UNIT['component'])) {
                 if ($_fn = mso_fe('components/' . trim($UNIT['component']) . '/' . trim($UNIT['component']) . '.php')) {
                     require $_fn;
                 }
             } elseif (isset($UNIT['option_key'], $UNIT['option_type'], $UNIT['option_default']) and trim($UNIT['option_key']) and trim($UNIT['option_type']) and trim($UNIT['option_default'])) {
                 echo mso_get_option(trim($UNIT['option_key']), trim($UNIT['option_type']), trim($UNIT['option_default']));
             } elseif (isset($UNIT['sidebar']) and trim($UNIT['sidebar'])) {
                 mso_show_sidebar($UNIT['sidebar']);
             }
         }
     }
 } else {
     // блоки рубрик на главной
     if (mso_get_option('home_cat_block', 'templates', '0')) {
         // обычный вывод
Example #19
0
    }
    if ($fn = get_component_fn('default_footer_component5')) {
        require $fn;
    }
}
if (function_exists('ushka')) {
    echo ushka('footer-end');
}
if (file_exists(getinfo('template_dir') . 'custom/footer-end.php')) {
    require getinfo('template_dir') . 'custom/footer-end.php';
}
?>
			</div><!-- div class="footer-wrap" -->
		</div><!-- div class="footer" -->
	</div><!-- div class="all-wrap" -->
</div><!-- div class="all" -->

<?php 
if (file_exists(getinfo('template_dir') . 'custom/body-end.php')) {
    require getinfo('template_dir') . 'custom/body-end.php';
}
?>
			
<?php 
if (function_exists('ushka')) {
    echo ushka('google_analytics');
    echo ushka('body_end');
}
mso_hook('body_end');
?>
</body></html>
Example #20
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('content-start');
}
if ($fn = mso_fe('custom/content-start.php')) {
    require $fn;
}
if ($fn = mso_fe('custom/content-out.php')) {
    require $fn;
} else {
    global $CONTENT_OUT;
    echo $CONTENT_OUT;
}
if (function_exists('ushka')) {
    echo ushka('content-end');
}
if ($fn = mso_fe('custom/content-end.php')) {
    require $fn;
}
# end of file
	
	CSS-стили: 
			>	@import url('components/logo-block.less');
		
	PHP-связи: 
			>	if ($fn = mso_fe('components/logo-block/logo-block.php')) require($fn);
*/
$pt = new Page_out();
// подготавливаем объект для вывода
// если в опции явно указан адрес лого, то берем его
$logo = trim(mso_get_option('default_header_logo_custom', 'templates', false));
if (!$logo) {
    $logo = getinfo('stylesheet_url') . 'images/logos/' . mso_get_option('default_header_logo', 'templates', 'logo01.png');
}
$logo = '<img src="' . $logo . '" alt="' . getinfo('name_site') . '" title="' . getinfo('name_site') . '">';
if (!is_type('home')) {
    $logo = $pt->link(getinfo('siteurl'), $logo);
}
// вывод
$pt->div_start('logo-block', 'wrap');
$pt->div_start('r1');
$pt->html($logo);
$pt->div_end('r1');
$pt->div_start('r2');
if (function_exists('ushka')) {
    echo ushka('logo-block');
}
$pt->div_end('r2');
$pt->clearfix();
$pt->div_end('logo-block', 'wrap');
# end file
Example #22
0
    // цикл вывода в отдельных юнитах
    if ($full_posts) {
        if ($fn = mso_find_ts_file('type/category/units/category-full.php')) {
            require $fn;
        }
    } else {
        if ($fn = mso_find_ts_file('type/category/units/category-list.php')) {
            require $fn;
        }
    }
    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;
Example #23
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
if (function_exists('ushka')) {
    echo ushka('footer-pre');
}
# end of file
Example #24
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
# секция HEAD
if ($fn = mso_fe('custom/head-section.php')) {
    require $fn;
} else {
    my_default_head_section();
}
// подключение через функцию
echo '<body' . (mso_get_val('body_class') ? ' class="' . mso_get_val('body_class') . '"' : '') . '>';
mso_hook('body_start');
if (function_exists('ushka')) {
    echo ushka('body_start');
}
if ($fn = mso_fe('custom/body-start.php')) {
    require $fn;
}
if (function_exists('ushka')) {
    echo ushka('header-pre');
}
if ($fn = mso_fe('custom/header-pre.php')) {
    require $fn;
}
# end of file
Example #25
0
}
if ($fn = mso_find_ts_file('main/main-start.php')) {
    require $fn;
}
echo NR . '<div class="mso-type-author">' . NR;
if ($f = mso_page_foreach('author-do')) {
    require $f;
} else {
    echo '<h1 class="mso-author">' . $title_page . '</h1>';
}
if ($pages) {
    if ($fn = mso_find_ts_file('type/author/units/author-do-pages.php')) {
        require $fn;
    }
    if (function_exists('ushka')) {
        echo ushka('author-do-pages');
    }
    // цикл вывода в отдельных юнитах
    if ($full_posts) {
        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);
Example #26
0
    $menu .= NR . 'admin/page | Список записей | | | i-newspaper-o';
    $menu .= NR . 'admin/files | Загрузки | | | i-download';
    $menu .= NR . '---';
    $menu .= NR . 'admin/cat | Рубрики | | | i-list-ul';
    $menu .= NR . 'admin/sidebars | Сайдбары | | | i-trello';
    $menu .= NR . 'admin/sidebars/widgets | Виджеты | | | i-paperclip';
    $menu .= NR . 'admin/plugins | Плагины | | | i-puzzle-piece';
    $menu .= NR . '---';
    $menu .= NR . 'admin/options | Опции сайта | | | i-wrench';
    $menu .= NR . 'admin/template_options | Настройки шаблона | | | i-gears';
    // $menu .= NR . '---';
    // $menu .= NR . 'http://max-3000.com/page/faq | ЧАВО для новичков';
    // $menu .= NR . 'http://max-3000.com/help | Центр помощи';
    // $menu .= NR . 'http://forum.max-3000.com/ | Форум поддержки';
    if (function_exists('ushka')) {
        $menu .= NR . ushka('main-menu-admin');
    }
    $menu .= NR . '---';
    $menu .= NR . 'logout | Выход | | | i-unlock';
    $menu .= NR . ']';
} elseif (is_login_comuser()) {
    $comuser = is_login_comuser();
    $menu .= NR . '[';
    if ($comuser['comusers_nik']) {
        $menu .= NR . '# | ' . $comuser['comusers_nik'] . ' | Своя страница | | i-user';
    } else {
        $menu .= NR . '# | Ваши ссылки';
    }
    $menu .= NR . 'users/' . $comuser['comusers_id'] . ' | Своя страница';
    $menu .= mso_hook('main_menu_add_comuser');
    $menu .= NR . '---';
Example #27
0
function tabs_widget_custom($options = array(), $num = 1)
{
    $out = '';
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (!isset($options['tabs'])) {
        $options['tabs'] = '';
    }
    if (!isset($options['type_func'])) {
        $options['type_func'] = 'widget';
    }
    $ar = explode("\n", trim($options['tabs']));
    // все табы в массив
    $tabs = array();
    // наши закладки
    if ($ar) {
        foreach ($ar as $key => $val) {
            $t = explode('|', $val);
            if (isset($t[0]) and isset($t[1])) {
                $tabs[$key]['title'] = trim($t[0]);
                $tabs[$key]['ushka'] = trim($t[1]);
            }
        }
    }
    if ($tabs) {
        $out .= NR . '<div class="mso-tabs"><ul class="mso-tabs-nav">' . NR;
        $current = ' mso-tabs-current';
        foreach ($tabs as $key => $tab) {
            $out .= '<li class="mso-tabs-elem' . $current . '"><span>' . $tab['title'] . '</span></li>' . NR;
            $current = '';
        }
        $out .= '</ul>' . NR;
        $visible = ' mso-tabs-visible';
        foreach ($tabs as $key => $tab) {
            if ($options['type_func'] == 'widget') {
                $func = $tab['ushka'];
                // category_widget 20
                $nm = 0;
                // разделим и определим номер виджета
                $arr_w = explode(' ', $func);
                // в массив
                if (sizeof($arr_w) > 1) {
                    $func = trim($arr_w[0]);
                    // первый - функция
                    $nm = trim($arr_w[1]);
                    // второй - номер виджета
                }
                // замены номера виджета из mso_show_sidebar()
                $nm = mso_slug($nm);
                $nm = str_replace('--', '-', $nm);
                if (function_exists($func)) {
                    $func = $func($nm);
                } else {
                    $func = 'no-func';
                }
            } else {
                if (function_exists('ushka')) {
                    $func = ushka($tab['ushka']);
                } else {
                    $func = '';
                }
            }
            $out .= NR . '<div class="mso-tabs-box' . $visible . '">' . $func . '</div>' . NR;
            $visible = '';
        }
        $out .= '</div><!-- div class="mso-tabs -->' . NR;
    }
    if ($out and $options['header']) {
        $out = $options['header'] . '<div class="mso-tabs-widget-content">' . $out . '</div><!-- /div.mso-tabs-widget-content -->';
    } else {
        $out = '<div class="mso-tabs-widget-content">' . $out . '</div><!-- div.mso-tabs-widget-content -->';
    }
    return $out;
}
Example #28
0
function randomtext_widget_custom($arg = array(), $num = 1)
{
    if (!isset($arg['header'])) {
        $arg['header'] = mso_get_val('widget_header_start', '<div class="mso-widget-header"><span>') . t('Цитата') . mso_get_val('widget_header_end', '</span></div>');
    }
    if (!isset($arg['block_start'])) {
        $arg['block_start'] = '<div class="random-text">';
    }
    if (!isset($arg['block_end'])) {
        $arg['block_end'] = '</div>';
    }
    if (!isset($arg['once_daily'])) {
        $arg['once_daily'] = 'random';
    }
    $text = '';
    # если есть ушка randomtext, то берем текст из неё
    if (function_exists('ushka')) {
        $text = ushka('randomtext', "\n");
    }
    if (!$text) {
        $text = 'Армейская дисциплина тяжела, но это тяжесть щита, а не ярма. /А. Ривароль/
Мораль — это важничанье человека перед природой. /Ф. Ницше/
Пусть о себе мнит каждый, что хочет. /Овидий/
Счастье есть лишь мечта, а горе реально. /Ф. Вольтер/
Соперничество — пища для гения. /Ф. Вольтер/
Повесть об этом стара, но слава нетленна. /Вергилий/
Кто не знает, что такое мир, не знает, где он сам… /Марк Аврелий/
Все понять — значит простить. /А. Сталь/
Усердный врач подобен пеликану. /К. Прутков/
Из всех плодов наилучшие приносит хорошее воспитание. /К. Прутков/
Доблесть милее вдвойне, если доблестный телом прекрасен. /Вергилий/
Ум всегда в дураках у сердца. /Ф. Ларошфуко/
Молчание — добродетель дураков. /Ф. Бэкон/
Плакать готова как раз оттого, что не над чем плакать. /Овидий/
Предосторожность проста, а раскаяние многосложно. /И. Гёте/
Дайте человеку цель, ради которой стоит жить, и он сможет выжить в любой ситуации. /Иоганн Вольфганг Гёте/
Замужество открывает женщинам глаза на саму себя. /Кузьма Чорный/
Функция литературы — превращать события в идеи. /Д. Сантаяна/
Сочинять не так уж трудно, труднее всего — зачеркивать лишние ноты. /Брамс/
Страх — всегдашний спутник неправды. /В. Шекспир/
Тень живет лишь при свете. /Ж. Ренар/
Уразумей, чтобы уверовать. /Августин/
Все — суета сует и томление духа. (Все — суета сует и ловля ветра) /Соломон/
Человек — это процесс его поступков. /А. Грамши/
Люди — это малые боги. /Г. Лейбниц/
Мудрость — это ум, настоянный на совести. /Фазиль Искандер/
Все свое я ношу с собой. /Ксенофан/
Слово — тень дела. /Демокрит/
Худших везде большинство. /Фалес/
Сущности не следует умножать без необходимости. /Оккам/
Новые взгляды сквозь старые щели. /Г. Лихтенберг/
Жестокость законов препятствует их соблюдению. /Ш. Монтескье/
Ни один льстец не льстит так искусно, как самолюбие. /Ф. Ларошфуко/
Надежды — сны бодрствующих. /Платон/
Людей мучают не вещи, а представления о них. /Эпиктет/
Если хочешь быть красивым, поступи в гусары. /К. Прутков/
Движущиеся тело и движение удовлетворительно не различимы. /Оккам/
Кто может — грабит, кто не может — ворует. /Д. И. Фонвизин/
Счастье подобно бабочке. Чем больше ловишь его, тем больше оно ускользает. Но если вы перенесете свое внимание на другие вещи, оно придет и тихонько сядет Вам на плечо. /В.Франкл (американский психотерапевт)/
Большинство из нас — это не мы. Наши мысли — это чужие суждения; наша жизнь — мимикрия; наши страсти — цитата. /Оскар Уайльд/
Все твои «беды» как летний снег: вот он есть, миг — и нет ничего, просто показалось… Не надо только все время тыкаться носом в прошлое или мечтать о том, каким бы могло стать будущее. /Макс Фрай/
Человек, по-настоящему мыслящий, черпает из своих ошибок не меньше познания, чем из своих успехов. /Джон Дьюи/
Человек лишь там чего — то добивается, где он сам верит в свои силы. /Людвиг Фейерах/
Искусство быть мудрым состоит в умении знать, на что не следует обращать внимания. /Уильям Джеймс/
Чем проще человек выражается, тем легче его понимают. /Фенимор Купер/
Когда Бог создавал время, он создал его достаточно. /Ирландская поговорка/
Это великолепные золотые часы на цепочке. Я горжусь ими. Их продал мне мой дедушка, когда лежал на смертном одре. /Вуди Аллен/';
    }
    $text = str_replace("\r", "", $text);
    $text = str_replace("\n\n", "\n", $text);
    $text = explode("\n", $text);
    // массив строк
    if ($arg['once_daily'] == 'day') {
        $d = date('d') + 1;
        // текущее число + 1
        if ($d <= sizeof($text)) {
            $out = $text[$d];
        } else {
            $out = $text[sizeof($text) - 1];
        }
    } else {
        $out = trim($text[mt_rand(0, count($text) - 1)]);
    }
    return $arg['header'] . $arg['block_start'] . $out . $arg['block_end'];
}