Example #1
0
function editor_digraph($args = array())
{
    $editor_config['url'] = getinfo('plugins_url') . 'editor_digraph/';
    $editor_config['dir'] = getinfo('plugins_dir') . 'editor_digraph/';
    if (isset($args['content'])) {
        $editor_config['content'] = $args['content'];
    } else {
        $editor_config['content'] = '';
    }
    if (isset($args['do'])) {
        $editor_config['do'] = $args['do'];
    } else {
        $editor_config['do'] = '';
    }
    if (isset($args['posle'])) {
        $editor_config['posle'] = $args['posle'];
    } else {
        $editor_config['posle'] = '';
    }
    if (isset($args['action'])) {
        $editor_config['action'] = ' action="' . $args['action'] . '"';
    } else {
        $editor_config['action'] = '';
    }
    if (isset($args['height'])) {
        $editor_config['height'] = (int) $args['height'];
    } else {
        $editor_config['height'] = (int) mso_get_option('editor_height', 'general', 400);
        if ($editor_config['height'] < 100) {
            $editor_config['height'] = 400;
        }
    }
    require $editor_config['dir'] . 'digraph.php';
}
Example #2
0
function pagination2_go($r = array())
{
    if (!isset($r['maxcount'])) {
        return $r;
    }
    $r_orig = $r;
    // сохраним исходный,	чтобы его же отдать дальше
    $options = mso_get_option('pagination2', 'plugins', array());
    // получаем опции
    if (!isset($r['old'])) {
        $r['old'] = isset($options['old']) ? $options['old'] : t('Старее »»»');
    }
    if (!isset($r['new'])) {
        $r['new'] = isset($options['new']) ? $options['new'] : t('««« Новее');
    }
    if (!isset($r['sep'])) {
        // разделитель
        $r['sep'] = isset($options['sep']) ? $options['sep'] : t(' | ');
    }
    # раньше - позже
    if ($ran1 = mso_url_paged_inc($r['maxcount'], -1)) {
        $ran1 = '<span class="new"><a href="' . $ran1 . '" title="' . $r['new'] . '">' . $r['new'] . '</a></span>';
    }
    if ($ran2 = mso_url_paged_inc($r['maxcount'], 1)) {
        $ran2 = '<span class="old"><a href="' . $ran2 . '" title="' . $r['old'] . '">' . $r['old'] . '</a></span>';
    }
    if (!$ran1 or !$ran2) {
        $r['sep'] = '';
    }
    $out = $ran1 . $r['sep'] . $ran2;
    if ($out) {
        echo NR . '<div class="pagination pagination2">' . $out . '</div>' . NR;
    }
    return $r_orig;
}
Example #3
0
function admin_ip_admin_init($args = array())
{
    // проверяем сегменты URL
    // получаем из опций секретный сегмент
    // если это секретный, то сбрасываем ip
    // получаем список разрешенных IP из опций
    // получаем текущий IP юзера
    // если его нет в разрешенных, то die('no');
    global $MSO;
    $options_key = 'plugin_admin_ip';
    $options = mso_get_option($options_key, 'plugins', array());
    if (!isset($options['secret'])) {
        $options['secret'] = '';
    }
    if (!isset($options['ip'])) {
        $options['ip'] = '';
    }
    if ($options['secret'] and mso_segment(3) == $options['secret']) {
        // сброс ip
        // http://localhost/codeigniter/admin/plugin_admin_ip/secret_to_reset - secret_to_reset
        $options['ip'] = '';
        mso_add_option($options_key, $options, 'plugins');
        mso_redirect('admin/plugin_admin_ip');
        // редирект на страницу плагина
    }
    if ($options['ip']) {
        // указаны IP
        $ips = explode("\n", $options['ip']);
        $curr_ip = $MSO->data['session']['ip_address'];
        $ok = false;
        // признак, что доступ разрешен
        foreach ($ips as $ip) {
            if (trim($ip) == $curr_ip) {
                $ok = true;
                break;
            }
        }
        if (!$ok) {
            die('Access denied');
        }
        // рубим
    }
    if (!mso_check_allow('admin_ip_admin_page')) {
        return $args;
        // 'Доступ запрещен';
    }
    $this_plugin_url = 'plugin_admin_ip';
    // url и hook
    # добавляем свой пункт в меню админки
    # первый параметр - группа в меню
    # второй - это действие/адрес в url - http://сайт/admin/demo
    #			можно использовать добавочный, например demo/edit = http://сайт/admin/demo/edit
    # Третий - название ссылки
    mso_admin_menu_add('plugins', $this_plugin_url, 'Admin IP');
    # прописываем для указаного admin_url_ + $this_plugin_url - (он будет в url)
    # связанную функцию именно она будет вызываться, когда
    # будет идти обращение по адресу http://сайт/admin/_null
    mso_admin_url_hook($this_plugin_url, 'admin_ip_admin_page');
    return $args;
}
Example #4
0
function colorbox_head_css($args = array())
{
    $url = getinfo('plugins_url') . 'colorbox/';
    $options = mso_get_option('plugin_colorbox', 'plugins', array());
    if (!isset($options['style'])) {
        $options['style'] = '1';
    }
    echo '<link rel="stylesheet" href="' . $url . 'style/' . $options['style'] . '/colorbox.css">';
}
Example #5
0
function calendar_widget_update($num = 1)
{
    $widget = 'calendar_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    # получаем из POST
    $newoptions['header'] = mso_widget_get_post($widget . '_header');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #6
0
function authors_widget_update($num = 1)
{
    $widget = 'authors_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    # обрабатываем POST
    $newoptions['header'] = mso_widget_get_post($widget . 'header');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #7
0
function global_cache_end($arg = array())
{
    # сброс кэша для страниц, которые отправлены как POST
    if (isset($_POST) and $_POST) {
        global_cache_key_flush();
    } else {
        $options = mso_get_option('plugin_global_cache', 'plugins', array());
        if (!isset($options['time'])) {
            $options['time'] = 15;
        }
        mso_add_cache(global_cache_key(), ob_get_flush(), $options['time'] * 60, true);
    }
}
Example #8
0
function guestbook_custom_page_404($args = false)
{
    $options = mso_get_option('plugin_guestbook', 'plugins', array());
    if (!isset($options['slug'])) {
        $options['slug'] = 'guestbook';
    }
    if (mso_segment(1) == $options['slug']) {
        require getinfo('plugins_dir') . 'guestbook/guestbook.php';
        // подключили свой файл вывода
        return true;
        // выходим с true
    }
    return $args;
}
Example #9
0
function page_comments_widget_update($num = 1)
{
    $widget = 'page_comments_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    # обрабатываем POST
    $newoptions['header'] = mso_widget_get_post($widget . 'header');
    $newoptions['limit'] = (int) mso_widget_get_post($widget . 'limit');
    $newoptions['format'] = mso_widget_get_post($widget . 'format');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #10
0
function cron_mso_options()
{
    $options = mso_get_option('plugin_cron', 'plugins', array());
    if (!isset($options['slug'])) {
        $options['slug'] = 'cron';
    }
    # ключ, тип, ключи массива
    mso_admin_plugin_options('plugin_cron', 'plugins', array('slug' => array('type' => 'text', 'name' => t('Адрес крона'), 'description' => t('Укажите адрес по которому будет вызываться крон. Например: «cron» - адрес') . ' ' . getinfo('siteurl') . '<strong>cron</strong>', 'default' => 'cron')), t('Настройки плагина cron'), 'Данный плагин предназначен для выполнения периодических задач. Вначале задайте адрес, по которому будет вызываться крон. После этого на сервере задайте период для своих задач и укажите в качестве программы:
		<pre>
GET ' . getinfo('siteurl') . $options['slug'] . '
		</pre>
		
		<p class="info">После этого те функции, которые определены для хука «cron» (плагины), будут выполняться в момент срабатывания крона на сервере.
		');
}
Example #11
0
function random_pages_widget_update($num = 1)
{
    $widget = 'random_pages_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    # обрабатываем POST
    $newoptions['header'] = mso_widget_get_post($widget . 'header');
    $newoptions['count'] = mso_widget_get_post($widget . 'count');
    $newoptions['page_type'] = mso_widget_get_post($widget . 'page_type');
    $newoptions['page_content'] = mso_widget_get_post($widget . 'page_content');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #12
0
function bbcode_autoload($args = array())
{
    $options = mso_get_option('plugin_bbcode', 'plugins', array());
    if (!array_key_exists('bbcode_level', $options)) {
        $options['bbcode_level'] = 1;
    }
    if ($options['bbcode_level'] == 1 or $options['bbcode_level'] == 3) {
        mso_hook_add('content', 'bbcode_custom', 20);
    }
    # хук на вывод контента
    if ($options['bbcode_level'] == 2 or $options['bbcode_level'] == 3) {
        mso_hook_add('comments_content', 'bbcode_custom', 20);
    }
    mso_hook_add('editor_content', 'bbcode_editor_content');
    // обработка текста для визуального редактора
}
Example #13
0
function search_form_widget_update($num = 1)
{
    $widget = 'search_form_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    # обрабатываем POST
    $newoptions['header'] = mso_widget_get_post($widget . 'header');
    $newoptions['text'] = mso_widget_get_post($widget . 'text');
    $newoptions['submit'] = mso_widget_get_post($widget . 'submit');
    $newoptions['style_text'] = mso_widget_get_post($widget . 'style_text');
    $newoptions['style_submit'] = mso_widget_get_post($widget . 'style_submit');
    $newoptions['text_posle'] = mso_widget_get_post($widget . 'text_posle');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #14
0
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>';
}
Example #15
0
function picasa_widget_update($num = 1)
{
    $widget = 'picasa_widget_' . $num;
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    $newoptions['header'] = mso_widget_get_post($widget . 'header');
    $newoptions['url'] = mso_widget_get_post($widget . 'url');
    $newoptions['show_type'] = mso_widget_get_post($widget . 'show_type');
    $newoptions['albums_count'] = (int) mso_widget_get_post($widget . 'albums_count');
    if ($newoptions['albums_count'] < 1) {
        $newoptions['albums_count'] = 0;
    }
    $newoptions['album_name'] = mso_widget_get_post($widget . 'album_name');
    $newoptions['img_size'] = mso_widget_get_post($widget . 'img_size');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #16
0
function editor_jw($args = array())
{
    global $MSO;
    $editor_config['url'] = $MSO->config['admin_plugins_url'] . 'editor_jw/';
    $editor_config['dir'] = $MSO->config['admin_plugins_dir'] . 'editor_jw/';
    // if (isset($args['content'])) $editor_config['content'] = mso_text_to_html($args['content']);
    if (isset($args['content'])) {
        $editor_config['content'] = $args['content'];
    } else {
        $editor_config['content'] = '';
    }
    if (!$editor_config['content']) {
        $editor_config['content'] = '<br>';
    }
    $editor_config['content'] = mso_hook('editor_content', $editor_config['content']);
    if (isset($args['do'])) {
        $editor_config['do'] = $args['do'];
    } else {
        $editor_config['do'] = '';
    }
    if (isset($args['posle'])) {
        $editor_config['posle'] = $args['posle'];
    } else {
        $editor_config['posle'] = '';
    }
    if (isset($args['action'])) {
        $editor_config['action'] = ' action="' . $args['action'] . '"';
    } else {
        $editor_config['action'] = '';
    }
    if (isset($args['height'])) {
        $editor_config['height'] = (int) $args['action'];
    } else {
        $editor_options = mso_get_option('editor_options', 'admin', array());
        if (isset($editor_options['editor_height'])) {
            $editor_config['height'] = (int) $editor_options['editor_height'];
        } else {
            $editor_config['height'] = 400;
        }
        if ($editor_config['height'] < 100) {
            $editor_config['height'] = 400;
        }
    }
    mso_hook_add('admin_head', 'editor_jw_admin_header');
    require $editor_config['dir'] . 'editor.php';
}
Example #17
0
function feedburner_init($args = array())
{
    if (!is_feed()) {
        return $args;
    }
    $options = mso_get_option('plugin_feedburner', 'plugins', array());
    if (!isset($options['key'])) {
        return $args;
    }
    if (!preg_match("!feedburner|feedvalidator!i", $_SERVER['HTTP_USER_AGENT'])) {
        if (mso_segment(1) == 'feed') {
            header("Location: http://feeds2.feedburner.com/" . trim($options['key']));
            header("HTTP/1.1 302 Temporary Redirect");
            exit;
        }
    }
    return $args;
}
Example #18
0
function editor_dumb($args = array())
{
    $options = mso_get_option('editor_dumb', 'plugins', array());
    // получаем опции
    $editor_config['url'] = getinfo('plugins_url') . 'editor_dumb/';
    $editor_config['dir'] = getinfo('plugins_dir') . 'editor_dumb/';
    if (isset($args['content'])) {
        $editor_config['content'] = $args['content'];
    } else {
        $editor_config['content'] = '';
    }
    if (isset($args['do'])) {
        $editor_config['do'] = $args['do'];
    } else {
        $editor_config['do'] = '';
    }
    if (isset($args['posle'])) {
        $editor_config['posle'] = $args['posle'];
    } else {
        $editor_config['posle'] = '';
    }
    if (isset($args['action'])) {
        $editor_config['action'] = ' action="' . $args['action'] . '"';
    } else {
        $editor_config['action'] = '';
    }
    if (isset($args['height'])) {
        $editor_config['height'] = (int) $args['height'];
    } else {
        $editor_config['height'] = (int) mso_get_option('editor_height', 'general', 400);
        if ($editor_config['height'] < 100) {
            $editor_config['height'] = 400;
        }
    }
    # Приведение строк с <br> в первозданный вид
    $editor_config['content'] = preg_replace('"&lt;br\\s?/?&gt;"i', "\n", $editor_config['content']);
    $editor_config['content'] = preg_replace('"&lt;br&gt;"i', "\n", $editor_config['content']);
    if (isset($options['editor'])) {
        $editor_type = $options['editor'] == 'BB-CODE' ? 'editor-bb.php' : 'editor.php';
    } else {
        $editor_type = 'editor.php';
    }
    require $editor_config['dir'] . $editor_type;
}
Example #19
0
function samborsky_ping_do($result = null)
{
    if (!is_array($list = mso_get_option('samborsky_ping_list', 'plugins'))) {
        $list = array();
    }
    $CI =& get_instance();
    $CI->load->library('xmlrpc');
    $CI->xmlrpc->method('weblogUpdates.ping');
    $CI->xmlrpc->request(array(mso_get_option('name_site', 'plugins'), getinfo('site_url'), getinfo('site_url') . 'feed'));
    foreach ($list as $key => $value) {
        if (!empty($value)) {
            $CI->xmlrpc->server($value, 80);
            $CI->xmlrpc->send_request();
        }
    }
    // Удадалим кеш
    mso_flush_cache();
    return $result;
}
Example #20
0
function auth_content_check($m)
{
    static $options;
    # статик, чтобы не получать каждый раз опции
    if (!isset($options)) {
        $options = mso_get_option('plugin_auth_content', 'plugins', array());
        if (!isset($options['message'])) {
            $options['message'] = 'Запись только для зарегистрированных';
        }
        if (!isset($options['format'])) {
            $options['format'] = '%MESSAGE%';
        }
    }
    if (is_login() || is_login_comuser()) {
        return $m[2];
    } else {
        return str_ireplace('%MESSAGE%', isset($m[1]) && $m[1] != '' ? $m[1] : $options['message'], $options['format']);
    }
}
Example #21
0
function polls_admin_head_list()
{
    $path = getinfo('plugins_url') . 'samborsky_polls/';
    $nmb_rec = mso_get_option('plugin_samborsky_polls', 'plugins', array('admin_number_records' => 10));
    $nmb_rec = $nmb_rec['admin_number_records'];
    $list_ajax = getinfo('ajax') . base64_encode('plugins/samborsky_polls/' . '/list-ajax.php');
    echo <<<EOFL

\t\t\t<!-- admin JS -->
\t\t<script src="{$path}js/admin.js"></script>
\t\t\t<!-- jQuery TableSorter + Pagination -->
\t\t<script>var nmb_rec = {$nmb_rec};</script>
\t\t<script src="{$path}js/jTPS.js"></script>
\t\t<script>
\t\t\tvar list_ajax = "{$list_ajax}";
\t\t\t\$(document).ready(function(){
\t\t\t\t\$('.samborsky_polls_table').jTPS({perPages:[nmb_rec]});
\t\t\t});
\t\t</script>

EOFL;
}
Example #22
0
function psevdocode_go($text)
{
    $options = mso_get_option('plugin_psevdocode', 'plugins', array());
    if (!isset($options['replace'])) {
        $psevdocodes = array('[список]' => '<ul class="text">', '[/список]' => '</ul>', '[номера]' => '<ol class="text">', '[/номера]' => '</ol>', '[отступ]' => '<blockquote class="otstup">', '[/отступ]' => '</blockquote>', '[комментарий]' => '<blockquote>', '[/комментарий]' => '</blockquote>', '[цитата]' => '<blockquote>', '[/цитата]' => '</blockquote>', '[врезка вправо]' => '<div class="vrezka-right">', '[врезка]' => '<div class="vrezka">', '[/врезка]' => '</div>', '[текст]' => '<pre>', '[/текст]' => '</pre>', '[подзаголовок]' => '<h2>', '[/подзаголовок]' => '</h2>', '[подзаголовок1]' => '<h3>', '[/подзаголовок1]' => '</h3>', '[врез]' => '<p class="vrez">', '[/врез]' => '</p>', '[подпись]' => '<p class="podpis">', '[/подпись]' => '</p>', '[---]' => '<hr>');
    } else {
        $psevdocodes_all = explode("\n", $options['replace']);
        // строки в массив
        $psevdocodes = array();
        foreach ($psevdocodes_all as $line) {
            if (trim($line)) {
                $kv = explode('||', $line);
                // строку, разделенную || в массив
                if (count($kv) > 1) {
                    $psevdocodes[trim($kv[0])] = trim($kv[1]);
                }
            }
        }
    }
    $text = strtr($text, $psevdocodes);
    return $text;
}
Example #23
0
function colorbox_head($args = array())
{
    $url = getinfo('plugins_url') . 'colorbox/';
    $options = mso_get_option('plugin_colorbox', 'plugins', array());
    if (!isset($options['style'])) {
        $options['style'] = '1';
    }
    if (!isset($options['effect'])) {
        $options['effect'] = 'elastic';
    }
    if (!isset($options['size'])) {
        $options['size'] = '0';
    }
    if (!isset($options['width'])) {
        $options['width'] = '75%';
    }
    if (!isset($options['height'])) {
        $options['height'] = '75%';
    }
    if (!isset($options['slideshowspeed'])) {
        $options['slideshowspeed'] = '2500';
    }
    echo '<link rel="stylesheet" href="' . $url . 'style/' . $options['style'] . '/colorbox.css" media="screen">';
    $size = '';
    if ($options['size'] == '1') {
        $size = ',width:"' . $options['width'] . '",height:"' . $options['height'] . '"';
    }
    echo '<script src="' . $url . 'js/jquery.colorbox-min.js"></script>
<script>
$(document).ready(function(){
	$(".gallery,.slideshow").find("a[href$=\'.jpg\'],a[href$=\'.jpeg\'],a[href$=\'.png\'],a[href$=\'.gif\'],a[href$=\'.bmp\']").attr("rel","cb");
	$("div.gallery a[rel=cb]").colorbox({rel:"true",transition:"' . $options['effect'] . '"' . $size . ',photo:"true"});
	$("a.lightbox").colorbox({transition:"' . $options['effect'] . '"' . $size . '});
	$("div.slideshow a[rel=cb]").colorbox({rel:"true",transition:"' . $options['effect'] . '"' . $size . ',slideshow:"true",slideshowSpeed:"' . $options['slideshowspeed'] . '",photo:"true"});
});
</script>';
}
Example #24
0
function twitter_widget_update($num = 1)
{
    $widget = 'twitter_widget_' . $num;
    // имя для опций = виджет + номер
    // получаем опции
    $options = $newoptions = mso_get_option($widget, 'plugins', array());
    $newoptions['header'] = mso_widget_get_post($widget . '_header');
    $newoptions['url'] = mso_widget_get_post($widget . '_url');
    $newoptions['count'] = (int) mso_widget_get_post($widget . '_count');
    if ($newoptions['count'] < 1) {
        $newoptions['count'] = 5;
    }
    $newoptions['max_word_description'] = (int) mso_widget_get_post($widget . '_max_word_description');
    if ($newoptions['max_word_description'] < 1) {
        $newoptions['max_word_description'] = 0;
    }
    $newoptions['format'] = mso_widget_get_post($widget . '_format');
    $newoptions['format_date'] = mso_widget_get_post($widget . '_format_date');
    $newoptions['footer'] = mso_widget_get_post($widget . '_footer');
    $newoptions['show_nick'] = mso_widget_get_post($widget . '_show_nick');
    if ($options != $newoptions) {
        mso_add_option($widget, $newoptions, 'plugins');
    }
}
Example #25
0
    exit('No direct script access allowed');
}
/**
 * MaxSite CMS
 * (c) http://max-3000.com/
 * 25-11-2015
 */
/*
Универсальный юнит для вывода записей по множеству критериев
[unit]
file = last-pages.php
limit = 3
[/unit]
Значение ключей по-умолчанию см. переменную $def
*/
# используем кэширование
$home_cache_time = (int) mso_get_option('home_cache_time', 'templates', 0);
$home_cache_key = getinfo('template') . '-' . __FILE__ . '-' . mso_current_paged() . '-' . $UNIT_NUM;
if ($home_cache_time > 0 and $k = mso_get_cache($home_cache_key)) {
    echo $k;
} else {
    $def = array('limit' => 3, 'cat_id' => "0", 'page_id' => "0", 'pagination' => false, 'type' => 'blog', 'order' => 'page_date_publish', 'order_asc' => 'desc', 'cut' => '»»»', 'show_cut' => false, 'date_now' => true, 'page_id_autor' => 0, 'thumb' => true, 'thumb_width' => 100, 'thumb_height' => 100, 'class_thumb' => 'b-left mar15-r rounded', 'content' => true, 'content_words' => 0, 'content_chars' => 0, 'content_cut' => '...', 'content_start' => '<div class="mso-page-content clearfix">', 'content_end' => '</div>', 'line1' => '[title][date]', 'line2' => '[thumb]', 'line3' => '', 'line4' => '[cat]', 'line5' => '<p class="t-right"><a href="[page_url]">Читать дальше</a></p>', 'title_start' => '<h4>', 'title_end' => '</h4>', 'block_start' => '<div class="layout-center flex flex-wrap pad5-rl">', 'block_end' => '</div>', 'page_start' => '<div class="w32 w48-tablet w100-phone pad20 mar15-tb bor1px bor-solid bor-gray400 rounded">', 'page_end' => '</div>', 'date' => 'j F Y, H:i', 'date_start' => '<p class="italic t90 i-calendar"><time datetime="[page_date_publish_iso]">', 'date_end' => '</time></p>', 'cat_start' => '<p class="i-folder t90">', 'cat_end' => '', 'cat_sep' => ',&NBSP;', 'tag_start' => '<p class="i-tag t90">', 'tag_end' => '</p>', 'tag_sep' => ',&NBSP;', 'author_start' => '', 'author_end' => '', 'read' => '»»»', 'read_start' => '<p>', 'read_end' => '</p>', 'comments_count_start' => '', 'comments_count_end' => '', 'placehold' => true, 'placehold_path' => 'http://placehold.it/', 'placehold_pattern' => '[W]x[H].png', 'placehold_file' => 'data', 'placehold_data_bg' => '#EEEEEE', 'pagination_start' => '', 'pagination_end' => '', 'exclude_page_allow' => true, 'exclude_page_add' => true);
    $UNIT = mso_merge_array($UNIT, $def);
    ob_start();
    $b = new Block_pages(array('limit' => $UNIT['limit'], 'cat_id' => $UNIT['cat_id'], 'page_id' => $UNIT['page_id'], 'pagination' => $UNIT['pagination'], 'type' => $UNIT['type'], 'order' => $UNIT['order'], 'order_asc' => $UNIT['order_asc'], 'cut' => $UNIT['cut'], 'show_cut' => $UNIT['show_cut'], 'date_now' => $UNIT['date_now'], 'page_id_autor' => $UNIT['page_id_autor'], 'exclude_page_allow' => $UNIT['exclude_page_allow']));
    if ($b->go) {
        $b->output(array('block_start' => $UNIT['block_start'], 'block_end' => $UNIT['block_end'], 'content' => $UNIT['content'], 'content_words' => $UNIT['content_words'], 'content_chars' => $UNIT['content_chars'], 'content_cut' => $UNIT['content_cut'], 'content_start' => $UNIT['content_start'], 'content_end' => $UNIT['content_end'], 'thumb' => $UNIT['thumb'], 'thumb_width' => $UNIT['thumb_width'], 'thumb_height' => $UNIT['thumb_height'], 'thumb_class' => $UNIT['class_thumb'], 'line1' => $UNIT['line1'], 'line2' => $UNIT['line2'], 'line3' => $UNIT['line3'], 'line4' => $UNIT['line4'], 'line5' => $UNIT['line5'], 'title_start' => $UNIT['title_start'], 'title_end' => $UNIT['title_end'], 'page_start' => $UNIT['page_start'], 'page_end' => $UNIT['page_end'], 'date' => $UNIT['date'], 'date_start' => $UNIT['date_start'], 'date_end' => $UNIT['date_end'], 'cat_start' => $UNIT['cat_start'], 'cat_end' => $UNIT['cat_end'], 'cat_sep' => $UNIT['cat_sep'], 'tag_start' => $UNIT['tag_start'], 'tag_end' => $UNIT['tag_end'], 'tag_sep' => $UNIT['tag_sep'], 'author_start' => $UNIT['author_start'], 'author_end' => $UNIT['author_end'], 'read' => $UNIT['read'], 'read_start' => $UNIT['read_start'], 'read_end' => $UNIT['read_end'], 'comments_count_start' => $UNIT['comments_count_start'], 'comments_count_end' => $UNIT['comments_count_start'], 'placehold' => $UNIT['placehold'], 'placehold_path' => $UNIT['placehold_path'], 'placehold_pattern' => $UNIT['placehold_pattern'], 'placehold_file' => $UNIT['placehold_file'], 'placehold_data_bg' => $UNIT['placehold_data_bg'], 'pagination_start' => $UNIT['pagination_start'], 'pagination_end' => $UNIT['pagination_end'], 'exclude_page_add' => $UNIT['exclude_page_add']));
    }
    mso_add_cache($home_cache_key, ob_get_flush(), $home_cache_time * 60);
}
# end of file
Example #26
0
            }
            $pages = mso_get_pages($par, $temp);
            if ($pages) {
                $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;
Example #27
0
<p class="info"><?php 
echo t('C помощью этого плагина вы можете организовать рассылку email-сообщений по списку.');
?>
</p>

<?php 
$options = mso_get_option($options_key, 'plugins', array());
if (!isset($options['maillist'])) {
    $options['maillist'] = '';
}
if (!isset($options['subject'])) {
    $options['subject'] = '';
}
if (!isset($options['files'])) {
    $options['files'] = '';
}
if (!isset($options['message'])) {
    $options['message'] = '';
}
if (!isset($options['from'])) {
    $options['from'] = mso_get_option('admin_email_server', 'general', '');
}
echo '<form action="" method="post">' . mso_form_session('f_session_id');
echo '<p><strong>' . t('Тема письма:') . '</strong></p><input name="f_subject" type="text" style="width: 100%" value="' . $options['subject'] . '">';
echo '<p><strong>' . t('От кого (email):') . '</strong></p><input name="f_from" type="text" style="width: 100%" value="' . $options['from'] . '">';
echo '<p><strong>' . t('Файл вложения (путь к файлу в «uploads»):') . '</strong></p><input name="f_files" type="text" style="width: 100%" value="' . $options['files'] . '">';
echo '<p><strong>' . t('Текст письма:') . '</strong></p><textarea name="f_message" style="width: 100%; height: 200px;">' . htmlspecialchars($options['message']) . '</textarea>';
echo '<p><strong>' . t('Список рассылки (один email в строке):') . '</strong></p><textarea name="f_list" style="width: 100%; height: 200px;">' . htmlspecialchars($options['maillist']) . '</textarea>';
echo '<br><input type="submit" name="f_submit_send" value="' . t('Разослать') . '" style="margin: 25px 0 5px 0;">';
echo '<input type="submit" name="f_save_list" value="' . t('Только сохранить список') . '" style="margin: 25px 0 5px 0;">';
echo '</form>';
Example #28
0
function antispam_check_spam_comusers($arg = array())
{
    # входящий параметр
    # array( 'comments_page_id' => $comments_page_id, 'comments_comusers_id' => $comusers_id,
    # 'comments_com_approved' => $comments_com_approved
    # выход: 1 разрешить 0 - модерация
    // смотрим есть ли id в списке модерируемом. если есть, то возвращаем на модерацию = 0
    $options_key = 'plugin_antispam';
    $options = mso_get_option($options_key, 'plugins', array());
    // все опции
    if (!isset($options['antispam_on'])) {
        return $arg['comments_com_approved'];
    }
    // включен ли антиспам
    if (!isset($options['moderation_comusers'])) {
        return $arg['comments_com_approved'];
    }
    // нет списка
    $nums = explode("\n", trim($options['moderation_comusers']));
    // список комюзеров
    foreach ($nums as $num) {
        if ((int) trim($num) == $arg['comments_comusers_id']) {
            return 0;
        }
    }
    return 1;
}
Example #29
0
 */
$CI =& get_instance();
$options_key = 'plugin_feedburner';
if ($post = mso_check_post(array('f_session_id', 'f_submit'))) {
    mso_checkreferer();
    $options = array();
    $options['key'] = $post['f_key'];
    mso_add_option($options_key, $options, 'plugins');
    echo '<div class="update">' . t('Обновлено!') . '</div>';
}
?>
<h1><?php 
echo t('Плагин FeedBurner');
?>
</h1>
<p class="info"><?php 
echo t('Плагин выполняет перенаправление вашего основного rss на сервис feedburner.com.');
?>
</p>

<?php 
$options = mso_get_option($options_key, 'plugins', array());
if (!isset($options['key'])) {
    $options['key'] = '';
}
$form = '<p><strong>' . t('Адрес вашего фида в FeedBurner.com:') . '</strong></p>
				<p>http://feeds2.feedburner.com/<input name="f_key" type="text" value="' . $options['key'] . '"></p>';
echo '<form action="" method="post">' . mso_form_session('f_session_id');
echo $form;
echo '<input type="submit" name="f_submit" value="' . t('Сохранить изменения') . '" style="margin: 25px 0 5px 0;">';
echo '</form>';
Example #30
0
<?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