• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mso_current_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mso_current_url函数的典型用法代码示例。如果您正苦于以下问题:PHP mso_current_url函数的具体用法?PHP mso_current_url怎么用?PHP mso_current_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了mso_current_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: login_form_widget

function login_form_widget($num = 1)
{
    $out = '';
    $widget = 'login_form_widget_' . $num;
    // имя для опций = виджет + номер
    $options = mso_get_option($widget, 'plugins', array());
    // получаем опции
    if (is_login()) {
        $out = '<p><strong>' . t('Привет,') . ' ' . getinfo('users_nik') . '!</strong><br>
				[<a href="' . getinfo('siteurl') . 'admin">' . t('управление') . '</a>]
				[<a href="' . getinfo('siteurl') . 'logout' . '">' . t('выйти') . '</a>] 
				</p>';
    } elseif ($comuser = is_login_comuser()) {
        if (!$comuser['comusers_nik']) {
            $cun = t('Привет!');
        } else {
            $cun = t('Привет,') . ' ' . $comuser['comusers_nik'] . '!';
        }
        $out = '<p><strong>' . $cun . '</strong><br>
				[<a href="' . getinfo('siteurl') . 'users/' . $comuser['comusers_id'] . '">' . t('своя страница') . '</a>]
				[<a href="' . getinfo('siteurl') . 'logout' . '">' . t('выйти') . '</a>] 
				</p>';
    } else {
        $after_form = isset($options['after_form']) ? $options['after_form'] : '';
        $out = mso_login_form(array('login' => t('Логин (email):') . ' ', 'password' => t('Пароль:') . ' ', 'submit' => '', 'form_end' => $after_form), getinfo('siteurl') . mso_current_url(), false);
    }
    if ($out) {
        if (isset($options['header']) and $options['header']) {
            $out = mso_get_val('widget_header_start', '<h2 class="box"><span>') . $options['header'] . mso_get_val('widget_header_end', '</span></h2>') . $out;
        }
    }
    return $out;
}
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:33,代码来源:index.php


示例2: captcha_go

function captcha_go($args = array())
{
    global $MSO;
    echo '
		<div class="captcha"><label for="comments_captha">' . tf('Введите нижние символы') . '</label>
		<input type="text" name="comments_captha" id="comments_captha" value="" maxlength="4" class="comments_captha"> <img src="' . create_captha_img(mso_md5($MSO->data['session']['session_id'] . mso_current_url())) . '" alt="" title="' . tf('Защита от спама: введите только нижние символы') . '"> <span>' . t('(обязательно)') . '</span><br><br></div>
		';
}
开发者ID:LeonisX,项目名称:cms,代码行数:8,代码来源:index.php


示例3: captcha_go

function captcha_go($args = array())
{
    global $MSO;
    # сама картинка формируется в img.php
    # в ней мы передаем сессию, текущую страницу и время (против кэширования)
    echo '
			<div class="captcha"><label for="comments_captha">' . tf('Введите нижние символы') . '</label>
			<input type="text" name="comments_captha" id="comments_captha" value="" maxlength="4" class="comments_captha"> <img src="' . getinfo('plugins_url') . 'captcha/img.php?image=' . $MSO->data['session']['session_id'] . '&amp;page=' . mso_slug(mso_current_url()) . '&amp;code=' . time() . '" alt="" title="' . tf('Защита от спама: введите только нижние символы') . '"> <span>' . t('(обязательно)') . '</span><br><br></div>
		';
}
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:10,代码来源:index.php


示例4: favorites_widget_custom

function favorites_widget_custom($options = array(), $num = 1)
{
    $out = '';
    $siteurl = getinfo('siteurl');
    // адрес сайта
    $current_url = mso_current_url();
    // текущая страница относительно сайта
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (isset($options['favorites'])) {
        $favorites = explode("\n", $options['favorites']);
        // разбиваем по строкам
        foreach ($favorites as $row) {
            $ar = explode('|', $row);
            // разбиваем по |
            // всего должно быть 2 элемента
            if (isset($ar[0]) and trim($ar[0])) {
                $href = '//' . trim($ar[0]) . '//';
                // адрес
                // удалим ведущий и конечные слэши, если есть
                $href = trim(str_replace('/', ' ', $href));
                $href = str_replace(' ', '/', $href);
                if (isset($ar[1]) and trim($ar[1])) {
                    $title = trim($ar[1]);
                    // название
                    if ($href == $current_url) {
                        $class = ' class="current-page" ';
                    } else {
                        $class = '';
                    }
                    $out .= NR . '<li' . $class . '><a href="' . $siteurl . $href . '" title="' . $title . '">' . $title . '</a></li>';
                }
            }
        }
    }
    if ($out) {
        $out = $options['header'] . NR . '<ul class="is_link favorites">' . $out . NR . '</ul>' . NR;
    }
    return $out;
}
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:41,代码来源:index.php


示例5: internal_links_custom

function internal_links_custom($text = '')
{
    static $a_link;
    // здесь хранится обработанный массив ссылок - чтобы не обрабатывать несколько раз
    global $_internal_links;
    $options = mso_get_option('plugin_internal_links', 'plugins', array());
    // только на page
    if (!isset($options['only_page_type'])) {
        $options['only_page_type'] = true;
    }
    if ($options['only_page_type'] and !is_type('page')) {
        return $text;
    }
    // не указаны ссылки
    if (!isset($options['links'])) {
        return $text;
    }
    if (!trim($options['links'])) {
        return $text;
    }
    if (!isset($options['default_class'])) {
        $options['default_class'] = '';
    }
    if (!isset($options['max_count'])) {
        $options['max_count'] = 1;
    } else {
        $options['max_count'] = (int) $options['max_count'];
    }
    if ($options['max_count'] === 0) {
        $options['max_count'] = -1;
    }
    // замена для preg_replace
    $links = explode("\n", str_replace("\r", '', trim($options['links'])));
    // все ссылки в массив
    if (!isset($a_link) or !$a_link) {
        $a_link = array();
        foreach ($links as $key => $link) {
            $l1 = explode('|', $link);
            if (isset($l1[0]) and isset($l1[1])) {
                $a_link[$key]['word'] = trim($l1[0]);
                $a_link[$key]['link'] = trim($l1[1]);
                if (strpos($a_link[$key]['link'], 'http://') === false) {
                    $a_link[$key]['link'] = getinfo('siteurl') . $a_link[$key]['link'];
                }
                if (isset($l1[2]) and trim($l1[2])) {
                    $a_link[$key]['class'] = trim($l1[2]);
                } else {
                    $a_link[$key]['class'] = trim($options['default_class']);
                }
            }
        }
    }
    $current_url = getinfo('siteurl') . mso_current_url(false);
    $limit = $options['max_count'];
    foreach ($a_link as $key) {
        $word = $key['word'];
        $link = $key['link'];
        if ($link == $current_url) {
            continue;
        }
        // ссылка на себя
        if (mb_stripos($text, $word, 0, 'UTF8') === false) {
            continue;
        }
        // нет вхождения
        if ($key['class']) {
            $class = ' class="' . $key['class'] . '"';
        } else {
            $class = '';
        }
        $regexp = '/(?!(?:[^<\\[]+[>\\]]|[^>\\]]+<\\/a>))(' . preg_quote($word, '/') . ')/usUi';
        $replace = "<a href=\"" . $link . "\"" . $class . ">\$0</a>";
        $text = preg_replace($regexp, $replace, $text, $limit);
    }
    // pr($text,1);
    return $text;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:77,代码来源:index.php


示例6: exit

<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
/**
 * MaxSite CMS
 * (c) http://max-3000.com/
 */
header('Content-type: text/html; charset=utf-8');
header('Content-Type: application/rss+xml');
$cache_key = mso_md5('feed_' . mso_current_url());
$k = mso_get_cache($cache_key);
if ($k) {
    return print $k;
}
// да есть в кэше
ob_start();
require_once getinfo('common_dir') . 'page.php';
// основные функции страниц
require_once getinfo('common_dir') . 'category.php';
// функции рубрик
$this->load->helper('xml');
$time_zone = getinfo('time_zone');
// 2.00 -> 200
$time_zone_server = date('O') / 100;
// +0100 -> 1.00
$time_zone = $time_zone + $time_zone_server;
// 3
$time_zone = number_format($time_zone, 2, '.', '');
// 3.00
开发者ID:Kmartynov,项目名称:cms,代码行数:31,代码来源:home.php


示例7: last_pages_widget_custom

function last_pages_widget_custom($arg = array(), $num = 1)
{
    if (!isset($arg['count'])) {
        $arg['count'] = 7;
    }
    if (!isset($arg['page_type'])) {
        $arg['page_type'] = 'blog';
    }
    if (!isset($arg['sort'])) {
        $arg['sort'] = 'page_date_publish';
    }
    if (!isset($arg['sort_order'])) {
        $arg['sort_order'] = 'desc';
    }
    if (!isset($arg['date_format'])) {
        $arg['date_format'] = 'd/m/Y';
    }
    if (!isset($arg['format'])) {
        $arg['format'] = '%TITLE%';
    }
    if (!isset($arg['comments_format'])) {
        $arg['comments_format'] = t(' - комментариев: ') . '%COUNT%';
    }
    if (!isset($arg['exclude_cat'])) {
        $arg['exclude_cat'] = '';
    }
    if (!isset($arg['include_cat'])) {
        $arg['include_cat'] = '';
    }
    if (!isset($arg['img_prev'])) {
        $arg['img_prev'] = '';
    }
    if (!isset($arg['img_prev_def'])) {
        $arg['img_prev_def'] = '';
    }
    if (!isset($arg['img_prev_attr'])) {
        $arg['img_prev_attr'] = 'class="left"';
    }
    if (!isset($arg['max_words'])) {
        $arg['max_words'] = 20;
    }
    if (!isset($arg['text_posle'])) {
        $arg['text_posle'] = '';
    }
    if (!isset($arg['header'])) {
        $arg['header'] = mso_get_val('widget_header_start', '<h2 class="box"><span>') . t('Последние записи') . mso_get_val('widget_header_end', '</span></h2>');
    }
    if (!isset($arg['block_start'])) {
        $arg['block_start'] = '<div class="last-pages"><ul class="is_link">';
    }
    if (!isset($arg['block_end'])) {
        $arg['block_end'] = '</ul></div>';
    }
    $cache_key = 'last_pages_widget' . serialize($arg) . $num;
    $k = mso_get_cache($cache_key);
    if ($k) {
        $current_url = getinfo('siteurl') . mso_current_url();
        // текущий урл
        $k = str_replace('<a href="' . $current_url . '">', '<a href="' . $current_url . '" class="current_url">', $k);
        return $k;
    }
    $arg['exclude_cat'] = mso_explode($arg['exclude_cat']);
    // рубрики из строки в массив
    $arg['include_cat'] = mso_explode($arg['include_cat']);
    // рубрики из строки в массив
    $CI =& get_instance();
    if (strpos($arg['format'], '%TEXT%') === false and strpos($arg['format'], '%TEXT_CUT%') === false and strpos($arg['format'], '%TEXT_PREV%') === false) {
        $CI->db->select('page.page_id, page_type_name, page_type_name AS page_content, page_slug, page_title, page_date_publish, page_status, COUNT(comments_id) AS page_count_comments', false);
    } else {
        $CI->db->select('page.page_id, page.page_content, page_type_name, page_slug, page_title, page_date_publish, page_status, COUNT(comments_id) AS page_count_comments');
    }
    $CI->db->from('page');
    $CI->db->where('page_status', 'publish');
    //$CI->db->where('page_date_publish <', date('Y-m-d H:i:s'));
    $time_zone = getinfo('time_zone');
    if ($time_zone < 10 and $time_zone > 0) {
        $time_zone = '0' . $time_zone;
    } elseif ($time_zone > -10 and $time_zone < 0) {
        $time_zone = '0' . $time_zone;
        $time_zone = str_replace('0-', '-0', $time_zone);
    } else {
        $time_zone = '00.00';
    }
    $time_zone = str_replace('.', ':', $time_zone);
    // $CI->db->where('page_date_publish < ', 'NOW()', false);
    $CI->db->where('page_date_publish < ', 'DATE_ADD(NOW(), INTERVAL "' . $time_zone . '" HOUR_MINUTE)', false);
    if ($arg['page_type']) {
        $CI->db->where('page_type_name', $arg['page_type']);
    }
    $CI->db->join('page_type', 'page_type.page_type_id = page.page_type_id');
    $CI->db->join('comments', 'comments.comments_page_id = page.page_id AND comments_approved = 1', 'left');
    if ($arg['exclude_cat']) {
        $CI->db->join('cat2obj', 'cat2obj.page_id = page.page_id', 'left');
        $CI->db->where_not_in('cat2obj.category_id', $arg['exclude_cat']);
    }
    if ($arg['include_cat']) {
        $CI->db->join('cat2obj', 'cat2obj.page_id = page.page_id', 'left');
        $CI->db->where_in('cat2obj.category_id', $arg['include_cat']);
    }
    $CI->db->order_by($arg['sort'], $arg['sort_order']);
//.........这里部分代码省略.........
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:101,代码来源:index.php


示例8: redirect_custom_page_404

function redirect_custom_page_404($args = false)
{
    // это почти аналог redirect_init с той разницей, что
    // хук срабатывает только при page_404
    // получаем опции
    // в опциях all - строки с редиректами
    // загоняем их в массив
    // смотрим текущий url
    // если он есть в редиректах, то редиректимся
    $options = mso_get_option('redirect', 'plugins', array());
    if (!isset($options['all404'])) {
        return $args;
    }
    // нет опций
    $all = explode("\n", $options['all404']);
    // разобъем по строкам
    if (!$all) {
        return $args;
    }
    // пустой массив
    // текущий адрес
    $current_url = mso_current_url(true);
    foreach ($all as $row) {
        $urls = explode('|', $row);
        //  адрес | редирект | 301, 302
        $urls = array_map('trim', $urls);
        if (isset($urls[0]) && isset($urls[1]) && $urls[0] && $urls[1]) {
            //проверяем, используются ли шаблоны в $urls[0]
            if (preg_match("/\\(.*\\)+/", $urls[0])) {
                $patern = preg_replace("![\\-\\?]+!", '\\\\$0', $urls[0]);
                if (preg_match("!" . $patern . "!i", $current_url, $match)) {
                    $urls[0] = $match[0];
                    $cn = count($match);
                    for ($i = 1; $i < $cn; $i++) {
                        $urls[1] = str_replace('$' . $i, $match[$i], $urls[1]);
                    }
                }
            }
            //
            if ($current_url != $urls[0]) {
                continue;
            }
            // адреса разные
            // совпали, делаем редирект
            if (isset($urls[2])) {
                mso_redirect($urls[1], true, $urls[2]);
            } else {
                mso_redirect($urls[1], true);
            }
        }
    }
    return $args;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:53,代码来源:index.php


示例9: mso_form_session

} else {
    // тут форма, если не было post
    echo '<div class="mso-guestbook"><form method="post">' . mso_form_session('f_session_id');
    foreach ($options['fields_arr'] as $key => $val) {
        echo '<p><label><span>' . t($val) . '</span>';
        if ($key != 'text') {
            echo '<input name="f_fields_guestbook[' . $key . ']" type="text"></label></p>';
        } else {
            echo '<textarea name="f_fields_guestbook[' . $key . ']" rows="10"></textarea></label></p>';
        }
    }
    // капча из плагина капчи
    if (!function_exists('create_captha_img')) {
        require_once getinfo('plugins_dir') . 'captcha/index.php';
    }
    $captcha = '<img src="' . create_captha_img(mso_md5($MSO->data['session']['session_id'] . mso_current_url())) . '" title="' . t('Защита от спама: введите только нижние символы') . '">';
    echo '<p><label><span>' . t('Нижние символы:') . $captcha . '</span>
		<input type="text" name="f_guestbook_captha" value="" maxlength="4" required></label></p>';
    echo '<p><button type="submit" class="i submit" name="f_submit_guestbook">' . t('Отправить') . '</button></p>';
    echo '</form></div>';
}
// тут последние отзывы с пагинацией
// нам нужна все поля таблицы
// вначале определим общее количество записей
$pag = array();
// пагинация
$pag['limit'] = $options['limit'];
// записей на страницу
$pag['type'] = '';
// тип
$CI->db->select('guestbook_id');
开发者ID:Kmartynov,项目名称:cms,代码行数:31,代码来源:guestbook.php


示例10: t

" title="<?php 
echo t('Вернуться к сайту');
?>
"><?php 
echo getinfo('name_site');
?>
</a></p>
	<p id="cms_name"><span>M</span>ax<span>S</span>ite CMS</p>
	<p id="entry"><?php 
echo t('Для входа в админ-панель введите логин и пароль');
?>
</p>

<?php 
if (!is_login()) {
    $redirect_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : getinfo('siteurl') . mso_current_url();
    mso_remove_hook('login_form_auth');
    # удалим все хуки для авторизации
    mso_login_form(array('login' => t('Логин'), 'password' => t('Пароль'), 'submit' => '', 'submit_value' => t('Войти'), 'form_end' => '<br clear="all">'), $redirect_url);
}
?>

	<p id="cms">&copy; <a href="http://max-3000.com/" target="_blank" title="<?php 
echo t('Система управления сайтом MaxSite CMS');
?>
">MaxSite CMS</a>, 2008&ndash;<?php 
echo date('Y');
?>
</p>
</div>
</body>
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:31,代码来源:loginform.php


示例11: maxsite_auth_custom

function maxsite_auth_custom($args = array())
{
    if (mso_segment(1) == 'maxsite-auth-form') {
        // здесь формируется форма для отправки запроса
        // данные отправляются POST
        // посетитель должен указать только адрес своего сайта
        // в hidden указываем нужные данные
        $redirect_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : getinfo('siteurl');
        echo '<html><head>
		<title>Авторизация</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		</head><body>
			<form method="post" action="' . getinfo('site_url') . 'maxsite-auth-form-post">
				<input type="hidden" name="redirect_url" value="' . urlencode($redirect_url) . '">
				Укажите адрес сайта (с http://): <input type="text" name="url" value="" size="80">
				<button type="submit">' . tf('Перейти к сайту') . '</button>
			</form>
		</body></html>';
        die;
        // Форма ОК
    } elseif (mso_segment(1) == 'maxsite-auth-form-post') {
        // здесь происходит приём указанного адреса сайта и редирект на него с нужными данными
        if ($post = mso_check_post(array('redirect_url', 'url'))) {
            $url = mb_strtolower($post['url']);
            $url = trim(str_replace('/', ' ', $url));
            $url = trim(str_replace('  ', ' ', $url));
            $url = trim(str_replace(' ', '/', $url));
            $url = str_replace('http:/', 'http://', $url);
            $url = $url . '/maxsite-auth-receive/' . base64_encode(getinfo('siteurl') . '##' . urldecode($post['redirect_url']) . '##' . substr(mso_md5(getinfo('siteurl')), 1, 5));
            mso_redirect($url, true);
        } else {
            mso_redirect('maxsite-auth-form');
        }
        // ошибочная форма - возвращаемся
    } elseif (mso_segment(1) == 'maxsite-auth-receive') {
        // принимаем входящие данные от другого сайта
        // здесь запрос на авторизацию
        // нужно проверить все входящие данные
        // проверить is_login
        // и сформировать форму с отправкой на входящий_сайт/maxsite-auth-reply
        if (!is_login()) {
            echo '<html><head>
		<title>Авторизация</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		</head><body>
			<div class="loginform">' . tf('Для авторизации необходимо войти на сайт') . '<br>';
            mso_login_form(array('login' => tf('Логин:') . ' ', 'password' => tf('Пароль:') . ' ', 'submit' => ''), getinfo('siteurl') . mso_current_url());
            echo '</div></body></html>';
            die;
            // выходим ОК
        } else {
            //проверяем разрешения группы
            if (!mso_check_allow('maxsite_auth_edit')) {
                die(tf('Доступ к авторизации запрещен'));
            }
            $options = mso_get_option('plugin_maxsite_auth', 'plugins', array());
            if (!isset($options['email']) or !$options['email']) {
                die(tf('Не задан ответный email'));
            }
            if (!isset($options['password']) or !$options['password']) {
                die(tf('Не задан ответный пароль'));
            }
            // смотрятся входные get-данные (расшифровка из base64) адрес-сайт1
            $data64 = mso_segment(2);
            if (!$data64) {
                die(tf('Нет данных'));
            }
            // отладка
            //	echo (getinfo('siteurl') . '##'. 'page/about' . '##' . substr(mso_md5(getinfo('siteurl')), 1, 5));
            //	echo '<br>'. base64_encode((getinfo('siteurl') . '##'. 'page/about' . '##' . substr(mso_md5(getinfo('siteurl')), 1, 5)));
            //	echo '<br>';
            // распаковываем данные
            $data = @base64_decode($data64);
            if (!$data) {
                die(tf('Ошибочные данные'));
            }
            //	адрес-сайт1##адрес текущей страницы1##открытый ключ
            $data = explode('##', $data);
            // обработаем предварительно массив
            $data_1 = array();
            foreach ($data as $element) {
                if ($d = trim($element)) {
                    $data_1[] = $d;
                }
            }
            // должно быть 3 элемента
            if (count($data_1) != 3) {
                die(tf('Неверное количество данных'));
            }
            // pr($data_1);
            $data_siteurl = $data_1[0];
            $data_redirect = $data_1[1];
            $data_key = $data_1[2];
            // все проверки пройдены
            // выводим форму с кнопкой Разрешить
            // данные для ответа
            //	- адрес исходный
            //	- адрес ответ - текущий
            //	- адрес текущей страницы1 - редирект
            //	- открытый ключ сайта2
//.........这里部分代码省略.........
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:101,代码来源:index.php


示例12: pagination_go

function pagination_go($r = array())
{
    global $MSO;
    $r_orig = $r;
    if (!$r) {
        return $r;
    }
    if (!isset($r['maxcount'])) {
        return $r;
    }
    if (!isset($r['limit'])) {
        return $r;
    }
    // нужно указать сколько записей выводить
    if (!isset($r['type'])) {
        $r['type'] = false;
    }
    // можно задать свой тип
    if (!isset($r['next_url'])) {
        $r['next_url'] = 'next';
    }
    $options = mso_get_option('plugin_pagination', 'plugins', array());
    // получаем опции
    if (!isset($r['range'])) {
        $r['range'] = isset($options['range']) ? (int) $options['range'] : 3;
    }
    if (!isset($r['sep'])) {
        $r['sep'] = isset($options['sep']) ? $options['sep'] : ' ';
    }
    if (!isset($r['sep2'])) {
        $r['sep2'] = isset($options['sep2']) ? $options['sep2'] : ' ';
    }
    if (!isset($r['format'])) {
        // $r['format'] =
        $r['format'][] = isset($options['format_first']) ? $options['format_first'] : '&lt;&lt;';
        $r['format'][] = isset($options['format_prev']) ? $options['format_prev'] : '&lt;';
        $r['format'][] = isset($options['format_next']) ? $options['format_next'] : '&gt;';
        $r['format'][] = isset($options['format_last']) ? $options['format_last'] : '&gt;&gt;';
    }
    # текущая пагинация вычисляется по адресу url
    # должно быть /next/6 - номер страницы
    $current_paged = mso_current_paged($r['next_url']);
    if ($current_paged > $r['maxcount']) {
        $current_paged = $r['maxcount'];
    }
    if ($r['type'] !== false) {
        $type = $r['type'];
    } else {
        $type = $MSO->data['type'];
    }
    // текущий адрес
    $cur_url = mso_current_url(true);
    // в текущем адресе нужно исключить пагинацию next
    if (preg_match("!/" . $r['next_url'] . "/!is", $cur_url, $matches, PREG_OFFSET_CAPTURE)) {
        $cur_url = substr($cur_url, 0, $matches[0][1]);
    }
    if ($type == 'home' and $current_paged == 1) {
        $cur_url = $cur_url . 'home';
    }
    // pr($cur_url);
    if ($type == 'home') {
        $home_url = getinfo('site_url');
    } else {
        $home_url = $cur_url;
    }
    $out = _pagination($r['maxcount'], $current_paged, $cur_url . '/' . $r['next_url'] . '/', $r['range'], $cur_url, '', $r['sep'], $home_url, $r['sep2']);
    if ($out) {
        $out = str_replace(array('%FIRST%', '%PREV%', '%NEXT%', '%LAST%'), $r['format'], $out);
        echo '<div class="pagination"><nav>' . $out . '</nav></div>';
    }
    return $r_orig;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:72,代码来源:index.php


示例13: _mso_logout

function _mso_logout()
{
    $ci =& get_instance();
    $ci->session->sess_destroy();
    $url = (isset($_SERVER['HTTP_REFERER']) and $_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    // проверяем, чтобы url был текущего сайта
    $pos = strpos($url, getinfo('site_url'));
    if ($pos === false or $pos > 0) {
        $url = '';
    }
    // чужой, сбрасываем переход
    // сразу же удаляем куку комюзера
    $comuser = mso_get_cookie('maxsite_comuser', false);
    if ($comuser) {
        $name_cookies = 'maxsite_comuser';
        $expire = time() - 60 * 60 * 24 * 365;
        // 365 дней
        $value = '';
        // mso_add_to_cookie('mso_edit_form_comuser', '', $expire);
        mso_add_to_cookie($name_cookies, $value, $expire, getinfo('siteurl') . mso_current_url());
        // в куку для всего сайта
    } elseif ($url) {
        mso_redirect($url, true);
    } else {
        mso_redirect(getinfo('site_url'), true);
    }
}
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:27,代码来源:common.php


示例14: loginza_auth_page_comment_form

function loginza_auth_page_comment_form($args = array())
{
    $options = mso_get_option('plugin_loginza_auth', 'plugins', array());
    // получаем опции
    if (!isset($options['widget_type'])) {
        $options['widget_type'] = 1;
    }
    $widget_type = $options['widget_type'];
    if (!isset($options['auth_title']) or empty($options['auth_title'])) {
        $options['auth_title'] = 'Loginza';
    }
    $auth_title = $options['auth_title'];
    if (!isset($options['providers_set'])) {
        $options['providers_set'] = 'google, yandex, facebook, twitter, loginza, myopenid, webmoney, openid';
    }
    $providers_set = $options['providers_set'];
    $curpage = getinfo('siteurl') . mso_current_url();
    $current_url = getinfo('siteurl') . 'maxsite-loginza-auth?' . $curpage;
    $auth_url = "https://loginza.ru/api/widget?token_url=" . urlencode($current_url . '#comments');
    if (!empty($providers_set)) {
        $providers_set = str_replace(' ', '', $providers_set);
        $auth_url .= '&amp;providers_set=' . $providers_set;
    } else {
        // пока что так
        $auth_url .= '&amp;providers_set=' . 'google,yandex,facebook,twitter,loginza,myopenid,webmoney,openid';
    }
    if ($widget_type == 0) {
        echo '<span><a rel="nofollow" href="' . $auth_url . '" class="loginza loginza_auth">';
        echo '<img src="http://loginza.ru/img/sign_in_button_gray.gif" alt="Войти через loginza"/></a></span>';
    } else {
        echo '<script src="http://s1.loginza.ru/js/widget.js"></script>';
        echo '<span><a rel="nofollow" href="' . $auth_url . '" class="loginza_auth">' . $auth_title . '</a></span>';
    }
    return $args;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:35,代码来源:index.php


示例15: addzakl_content_end

function addzakl_content_end($args = array())
{
    global $page;
    $options = mso_get_option('plugin_addzakl', 'plugins', array());
    $def_options = array('size' => 16, 'text-do' => '', 'text-posle' => '', 'twitter' => 1, 'facebook' => 1, 'vkontakte' => 1, 'odnoklassniki' => 1, 'mail-ru' => 1, 'yaru' => 1, 'rutvit' => 1, 'myspace' => 1, 'technorati' => 1, 'digg' => 1, 'friendfeed' => 1, 'pikabu' => 1, 'blogger' => 1, 'liveinternet' => 1, 'livejournal' => 1, 'memori' => 1, 'google-bookmarks' => 1, 'bobrdobr' => 1, 'mister-wong' => 1, 'yahoo-bookmarks' => 1, 'yandex' => 1, 'delicious' => 1, 'gplusone' => 1);
    $options = array_merge($def_options, $options);
    $size = (int) $options['size'];
    // размер икнонок
    $sep = ' ';
    # разделитель мужду кнопками - можно указать свой
    # ширина и высота картинок
    $width_height = ' width="' . $size . '" height="' . $size . '"';
    if ($size == 16) {
        // если размер 16, то каталог /images/
        $path = getinfo('plugins_url') . 'addzakl/images/';
    } else {
        // каталог /imagesXX/
        $path = getinfo('plugins_url') . 'addzakl/images' . $size . '/';
    }
    # путь к картинкам
    $post_title = urlencode(stripslashes($page['page_title'] . ' - ' . mso_get_option('name_site', 'general')));
    $post_link = getinfo('siteurl') . mso_current_url();
    $out = '';
    if ($options['twitter']) {
        $img_src = 'twitter.png';
        $link = '<a rel="nofollow" href="http://twitter.com/home/?status=' . urlencode(stripslashes(mb_substr($page['page_title'], 0, 139 - mb_strlen($post_link, 'UTF8'), 'UTF8') . ' ' . $post_link)) . '">';
        $out .= $link . '<img title="Добавить в Twitter" alt="twitter.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['facebook']) {
        $img_src = 'facebook.png';
        $link = '<a rel="nofollow" href="http://www.facebook.com/sharer.php?u=' . $post_link . '">';
        $out .= $sep . $link . '<img title="Поделиться в Facebook" alt="facebook.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['vkontakte']) {
        $img_src = 'vkontakte.png';
        $link = '<a rel="nofollow" href="http://vkontakte.ru/share.php?url=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Поделиться В Контакте" alt="vkontakte.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['odnoklassniki']) {
        $img_src = 'odnoklassniki.png';
        $link = '<a rel="nofollow" href="http://www.odnoklassniki.ru/dk?st.cmd=addShare&amp;st._surl=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Добавить в Одноклассники" alt="odnoklassniki.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['mail-ru']) {
        $img_src = 'mail-ru.png';
        $link = '<a rel="nofollow" href="http://connect.mail.ru/share?url=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Поделиться в Моем Мире@Mail.Ru" alt="mail.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['yaru']) {
        $img_src = 'yaru.png';
        $link = '<a rel="nofollow" href="http://my.ya.ru/posts_add_link.xml?URL=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Поделиться в Я.ру" alt="ya.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['rutvit']) {
        $img_src = 'rutvit.png';
        $link = '<a rel="nofollow" href="http://rutvit.ru/tools/widgets/share/popup?url=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Добавить в РуТвит" alt="rutvit.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['myspace']) {
        $img_src = 'myspace.png';
        $link = '<a rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?u=' . $post_link . '&amp;t=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Добавить в MySpace" alt="myspace.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    /*
    if ($options['buzz'])
    {
    	$img_src = 'buzz.png';
    	$link = '<a rel="nofollow" href="http://www.google.com/buzz/post?message=' . $post_link . '&amp;url=' . $post_title . '&amp;srcURL=' . getinfo('siteurl') . '">';
    	$out .= $sep . $link . '<img title="Добавить в Google Buzz" alt="Google Buzz" src="' . $path . $img_src  . '"' . $width_height . '></a>';		
    }
    */
    if ($options['technorati']) {
        $img_src = 'technorati.png';
        $link = '<a rel="nofollow" href="http://www.technorati.com/faves?add=' . $post_link . '">';
        $out .= $sep . $link . '<img title="Добавить в Technorati" alt="technorati.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['digg']) {
        $img_src = 'digg.png';
        $link = '<a rel="nofollow" href="http://digg.com/submit?url=' . $post_link . '">';
        $out .= $sep . $link . '<img title="Добавить в Digg" alt="digg.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['friendfeed']) {
        $img_src = 'friendfeed.png';
        $link = '<a rel="nofollow" href="http://www.friendfeed.com/share?title=' . $post_link . '">';
        $out .= $sep . $link . '<img title="Добавить в FriendFeed" alt="friendfeed.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['pikabu']) {
        $img_src = 'pikabu.png';
        $link = '<a rel="nofollow" href="http://pikabu.ru/add_story.php?story_url=' . $post_link . '&amp;title=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Добавить в Pikabu" alt="pikabu.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['blogger']) {
        $img_src = 'blogger.png';
        $link = '<a rel="nofollow" href="http://www.blogger.com/blog_this.pyra?t&amp;u=' . $post_link . '&amp;n=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Опубликовать в Blogger.com" alt="blogger.com" src="' . $path . $img_src . '"' . $width_height . '></a>';
    }
    if ($options['liveinternet']) {
        $img_src = 'liveinternet.png';
        $link = '<a rel="nofollow" href="http://www.liveinternet.ru/journal_post.php?action=n_add&amp;cnurl=' . $post_link . '&amp;cntitle=' . $post_title . '">';
        $out .= $sep . $link . '<img title="Опубликовать в LiveInternet" alt="liveinternet.ru" src="' . $path . $img_src . '"' . $width_height . '></a>';
//.........这里部分代码省略.........
开发者ID:rb2,项目名称:MaxSite-CMS,代码行数:101,代码来源:index.php


示例16: mso_create_list


//.........这里部分代码省略.........
    if ($options['class_child']) {
        $class_child = ' class="' . $options['class_child'] . ' [LEVEL]"';
    }
    static $level = 0;
    $class_child = str_replace('[LEVEL]', 'level' . $level, $class_child);
    if ($options['class_child_style']) {
        $class_child_style = ' style="' . $options['class_child_style'] . '"';
    }
    if ($options['class_ul']) {
        $class_ul = ' class="' . $options['class_ul'] . '"';
    }
    if ($options['class_ul_style']) {
        $class_ul_style = ' style="' . $options['class_ul_style'] . '"';
    }
    if ($options['class_current']) {
        $class_current = ' class="' . $options['class_current'] . '"';
    }
    if ($options['class_current_style']) {
        $class_current_style = ' style="' . $options['class_current_style'] . '"';
    }
    if ($options['class_li']) {
        $class_li = ' class="' . $options['class_li'] . ' group"';
    } else {
        $class_li = ' class="group"';
    }
    if ($options['class_li_style']) {
        $class_li_style = ' style="' . $options['class_li_style'] . '"';
    }
    if ($child) {
        $out = NR . '	<ul' . $class_child . $class_child_style . '>';
    } else {
        $out = NR . '<ul' . $class_ul . $class_ul_style . '>';
    }
    $current_url = getinfo('siteurl') . mso_current_url();
    // текущий урл
    // из текущего адресу нужно убрать пагинацию
    $current_url = str_replace('/next/' . mso_current_paged(), '', $current_url);
    foreach ($a as $elem) {
        $title = $elem[$options['title']];
        $elem_slug = mso_strip($elem[$options['link']]);
        // slug элемента
        $url = getinfo('siteurl') . $options['prefix'] . $elem_slug;
        // если это page, то нужно проверить вхождение этой записи в элемент рубрики
        // если есть, то ставим css-класс curent-page-cat
        $curent_page_cat_class = is_page_cat($elem_slug, false, false) ? ' class="curent-page-cat"' : '';
        $link = '<a' . $options['nofollow'] . ' href="' . $url . '" title="' . htmlspecialchars($title) . '"' . $curent_page_cat_class . '>';
        if (isset($elem[$options['descr']])) {
            $descr = $elem[$options['descr']];
        } else {
            $descr = '';
        }
        if (isset($elem[$options['count']])) {
            $count = $elem[$options['count']];
        } else {
            $count = '';
        }
        if (isset($elem[$options['id']])) {
            $id = $elem[$options['id']];
        } else {
            $id = '';
        }
        if (isset($elem[$options['slug']])) {
            $slug = $elem[$options['slug']];
        } else {
            $slug = '';
        }
开发者ID:rettebinu,项目名称:cms,代码行数:67,代码来源:common.php


示例17: t

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mso_date_convert函数代码示例发布时间:2022-05-15
下一篇:
PHP mso_create_allow函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap