当前位置: 首页>>代码示例>>PHP>>正文


PHP GetSiteUrl函数代码示例

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


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

示例1: IndexForumMarkRead

function IndexForumMarkRead()
{
    $mark_forums = array();
    // Форумы на которых устанавливать метки
    $forums_tree = ForumTree::Instance();
    if (isset($_GET['forum'])) {
        // Только внутри определённого форума
        $forum = SafeDB($_GET['forum'], 11, int);
        $mark_forums = $forums_tree->GetAllAccessForumId($forum);
    } else {
        // На всех форумах
        $mark_forums = $forums_tree->GetAllAccessForumId();
    }
    $user_id = System::user()->Get('u_id');
    if (System::user()->Auth) {
        // Загружаем данные о прочтении тем пользователем
        $read_data = Forum_Marker_GetReadData();
        // Загружаем топики (агрегированы по forum_id)
        $topics = ForumCacheGetTopics();
        $del_where = '';
        $insert_values = array();
        $time = time();
        foreach ($mark_forums as $forum_id) {
            if (!isset($topics[$forum_id])) {
                continue;
            }
            foreach ($topics[$forum_id] as $topic) {
                $tid = SafeEnv($topic['id'], 11, int);
                // Не прочитана или метка устарела
                if (!isset($read_data[$topic['id']])) {
                    $insert_values[] = "'{$user_id}','{$tid}','{$time}'";
                    // Добавить новую метку
                } elseif ($read_data[$topic['id']]['date'] < $topic['last_post']) {
                    $del_where .= "(`tid`='{$tid}' and `mid`= '{$user_id}') or ";
                    // Удалить текущую метку
                    $insert_values[] = "'{$user_id}','{$tid}','{$time}'";
                    // Добавить новую метку
                }
            }
        }
        // Удаляем устаревшие метки
        if ($del_where != '') {
            $del_where = substr($del_where, 0, -4);
            // Удаляем .or.
            System::database()->Delete('forum_topics_read', $del_where);
        }
        // Добавляем новые метки
        // TODO: В будущем нужно перейти на InnoDB и использовать транзакции как в MySQL так и в FilesDB.
        if (count($insert_values) > 0) {
            foreach ($insert_values as $vals) {
                System::database()->Insert('forum_topics_read', $vals);
            }
        }
    }
    GO(GetSiteUrl() . Ufu('index.php?name=forum' . (isset($forum) ? '&op=showforum&forum=' . $forum : ''), 'forum/' . (isset($forum) ? '{forum}/' : '')));
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:56,代码来源:markread.php

示例2: sites

 function sites()
 {
     $links = $this->links();
     $sites = array();
     foreach ($links as $value) {
         $sites[] = GetSiteUrl($value);
     }
     $sites = distinct_array($sites);
     return $sites;
 }
开发者ID:tanny2015,项目名称:DataStructure,代码行数:10,代码来源:spider_class.php

示例3: Ufu

/**
 * Безопасная функция для вывода ЧПУ ссылок.
 * @param               $Url
 * @param string        $Ufu
 * @param string|bool   $NavLink
 * @param string        $NavParam
 * @param int           $MinOrder
 * @return string
 * @examples
 *           Ufu('index.php?name=news&topic=5', 'news/{topic}/');
 *           Ufu('index.php?name=news&topic=5', 'news:show-topics');
 */
function Ufu($Url, $Ufu = '', $NavLink = null, $NavParam = null, $MinOrder = 10000)
{
    if (System::config('general/ufu')) {
        if ($Url == 'index.php') {
            return GetSiteUrl() . 'index.html';
        }
        // Вытаскиваем параметры ссылки
        $p = strpos($Url, '?');
        if ($p !== false) {
            $Url = substr($Url, $p + 1);
        }
        $p = strrpos($Url, '#');
        if ($p !== false) {
            $anchor = substr($Url, $p);
            $Url = substr($Url, 0, $p);
        } else {
            $anchor = '';
        }
        parse_str($Url, $params);
        // NavLink
        if (isset($NavLink) && !is_string($NavLink)) {
            if ($NavLink === true) {
                if (isset($NavParam)) {
                    $NavLink = $NavParam;
                } else {
                    $NavLink = 'page';
                }
            } else {
                $NavLink = null;
            }
        }
        // Параметры для замены ключей в ufu шаблоне
        $replace = array();
        foreach ($params as $key => $val) {
            $replace['{' . $key . '}'] = rawurlencode(Cp1251ToUtf8($val));
        }
        // Получаем правило
        $rule = UfuGetRules($Ufu);
        if (!isset($rule)) {
            if (isset($NavLink)) {
                $params[$NavLink] = '1';
            }
            $rule = UfuAddRewriteRule($Ufu, $params, $MinOrder);
        }
        // Парсим шаблон ссылки заменяя ключи
        return strtr($rule['ufu'], $replace) . $anchor;
    } else {
        if ($Url == 'index.php') {
            return GetSiteUrl() . $Url;
        } else {
            $Url = new Url($Url);
            return $Url->ToString();
        }
    }
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:67,代码来源:ufu.php

示例4: IndexForumShowTopic


//.........这里部分代码省略.........
            }
            SmiliesReplace($vars['text']);
            $vars['text'] = nl2br($vars['text']);
            $vars['text'] = BbCodePrepare($vars['text']);
            if ($max_word_length > 0) {
                $vars['text'] = word_wrapped_string($vars['text'], $max_word_length);
            }
        }
        // Обрабатываем данные сообщения
        // Пользователь
        $user_info = GetUserInfo($post_user_id);
        $vars['usertopics'] = '<a href="' . Ufu('index.php?name=forum&op=usertopics&user=' . $post_user_id, 'forum/usertopics/{user}/') . '">' . $forum_lang['allusertopics'] . '</a>';
        if ($user_info['rank_name'] != '') {
            $vars['author'] = '<a href="' . Ufu('index.php?name=user&op=userinfo&user=' . $post_user_id, 'user/{user}/info/') . '">' . $user_info['name'] . '</a>';
            $vars['author_name'] = $user_info['name'];
        } else {
            $vars['author'] = $post['name'];
            $vars['author_name'] = $post['name'];
        }
        if ($user_info['hideemail'] == '0') {
            $vars['email'] = AntispamEmail($user_info['email']);
        } else {
            $vars['email'] = '&nbsp;';
        }
        if ($user_info['url'] != '') {
            $vars['homepage'] = '<a href="http://' . $user_info['url'] . '" target="_blank">' . $user_info['url'] . '</a>';
        } else {
            $vars['homepage'] = '&nbsp;';
        }
        $vars['icq'] = $user_info['icq'];
        if ($user_info['online']) {
            $vars['status'] = $forum_lang['user_online'];
        } else {
            $vars['status'] = '';
        }
        $vars['rank_image'] = $user_info['rank_image'] != '' ? $user_info['rank_image'] : '';
        $vars['rank_name'] = $user_info['rank_name'] != '' ? $user_info['rank_name'] : '';
        $vars['avatar'] = $user_info['avatar_file'] != '' ? $user_info['avatar_file'] : GetPersonalAvatar(0);
        $vars['regdate'] = TimeRender($user_info['regdate'], false, true);
        if (isset($user_info['data']['forum_counters'])) {
            $vars['user_posts_count'] = $user_info['data']['forum_counters']['posts'];
            $vars['user_topics_count'] = $user_info['data']['forum_counters']['topics'];
        } else {
            $vars['user_posts_count'] = '0';
            $vars['user_topics_count'] = '0';
        }
        // Сообщение
        $vars['public'] = $forum_lang['added'] . TimeRender($post['public']);
        $vars['public_date'] = TimeRender($post['public']);
        $vars['ip'] = SafeDB($post['user_ip'], 19, str);
        $vars['topic_id'] = $topic_id;
        $vars['id'] = SafeDB($post['id'], 11, int);
        $vars['nodelete'] = SafeDB($post['delete'], 1, int) == 1 ? false : true;
        $vars['is_admin_and_nodelete'] = $vars['nodelete'] && $user_admin;
        $vars['page'] = $page;
        // is_current_user Пользователь является владельцем сообщения (кнопки редактировать и удалить)
        if ($post['delete'] == '0') {
            $vars['is_current_user'] = $user_id == $post['user_id'] && $topic['close_topics'] == '0' || $user_admin;
        } else {
            $vars['is_current_user'] = false;
        }
        if ($one_post === false) {
            $vars['num'] = $page > 1 ? $page * $posts_on_page - $posts_on_page + $i : $i;
            $vars['url'] = "javascript:link_post('" . GetSiteUrl() . Ufu("index.php?name=forum&op=post&topic=" . $topic_id . "&post=" . $post['id'], 'forum/t{topic}/post{post}.html') . "')";
        } else {
            $vars['num'] = '';
            $vars['url'] = 'javascript:history.go(-1)';
        }
        $vars['is_forum_member'] = $is_forum_member;
        System::site()->AddSubBlock('forum_posts', true, $vars, array(), 'module/forum_post.html');
        $i++;
    }
    // Форма добавления сообщений
    System::site()->AddBlock('post_form', $forum_config['add_post'], false);
    ForumRenderPostForm(false, $forum_id, $topic_id, 0, '', '', $is_forum_member);
    // Подписка на тему
    System::site()->AddBlock('subscription', $forum_config['new_message_email'], false, 'subs');
    $vars_subs = array();
    $vars_subs['topic'] = $topic_id;
    $vars_subs['sub_status'] = Forum_Subscription_Status($topic_id);
    $vars_subs['status'] = $vars_subs['sub_status'] ? 'Отписаться от этой темы' : 'Подписаться на эту тему';
    System::site()->SetVars('subscription', $vars_subs);
    System::site()->AddBlock('is_forum_member', $is_forum_member, false, 'marker');
    System::site()->SetVars('is_forum_member', array('id' => $topic_id));
    // Подключаем шаблон
    System::site()->AddTemplatedBox('', 'module/forum_showtopic.html');
    // Выводим блок онлайн
    $online->Render($forum_id, $topic_id, $forum_lang['current_online'], 'forum_online');
    // Предыдущая и следующая тема
    System::site()->AddBlock('forum_prev_topic', isset($prev_topic), false, 'topic');
    if (isset($prev_topic)) {
        System::site()->SetVars('forum_prev_topic', array('url' => Ufu('index.php?name=forum&op=showtopic&topic=' . SafeDB($prev_topic['id'], 11, int), 'forum/topic{topic}.html'), 'title' => SafeDB($prev_topic['title'], 255, str), 'lang_prev_topic' => $forum_lang['prev_topic']));
    }
    System::site()->AddBlock('forum_next_topic', isset($next_topic), false, 'topic');
    if (isset($next_topic)) {
        System::site()->SetVars('forum_next_topic', array('url' => Ufu('index.php?name=forum&op=showtopic&topic=' . SafeDB($next_topic['id'], 11, int), 'forum/topic{topic}.html'), 'title' => SafeDB($next_topic['title'], 255, str), 'lang_next_topic' => $forum_lang['next_topic']));
    }
    // Быстрый переход по форумам
    ForumQuickTransitionBox($forum_id, $forum_lang['quick_transition']);
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:101,代码来源:showtopic.php

示例5: Update_link

function Update_link($url)
{
    global $db, $bug_url;
    $is_success = FALSE;
    $is_shoulu = FALSE;
    $spider = new spider();
    $spider->url($url);
    $title = $spider->title;
    $fulltxt = $spider->fulltxt(800);
    $pagesize = $spider->pagesize;
    $keywords = $spider->keywords;
    $htmlcode = $spider->htmlcode;
    $description = $spider->description;
    $site_url = GetSiteUrl($url);
    $site = $db->get_one("select * from ve123_sites where url='" . $site_url . "'");
    $site_id = $site["site_id"];
    echo $title;
    $array = array('title' => $title, 'fulltxt' => $fulltxt, 'pagesize' => $pagesize, 'keywords' => $keywords, 'description' => $description, 'site_id' => $site_id);
    $db->query("update ve123_links set updatetime='" . time() . "' where url='" . $url . "'");
    if (!empty($title)) {
        $s = array();
        $s = explode("?", $title);
        if ($pagesize > 1 && count($s) < 2) {
            $domain = GetSiteUrl($url);
            $site = $db->get_one("select * from ve123_sites where url='" . $domain . "'");
            if (!empty($site)) {
                if (!empty($site["include_word"])) {
                    foreach (explode(",", $site["include_word"]) as $value) {
                        if (stristr($htmlcode, $value)) {
                            $include_num += 1;
                        }
                    }
                    if ($include_num <= 0) {
                        $is_shoulu = FALSE;
                    }
                } else {
                    $is_shoulu = TRUE;
                }
                if (!empty($site["not_include_word"])) {
                    foreach (explode(",", $site["not_include_word"]) as $value) {
                        if (stristr($htmlcode, $value)) {
                            $not_include_num += 1;
                        }
                    }
                    if ($not_include_num > 0) {
                        $is_shoulu = FALSE;
                    }
                }
            } else {
                $is_shoulu = TRUE;
            }
            if ($is_shoulu) {
                $db->update("ve123_links", $array, "url='" . $url . "'");
                //file_put_contents(PATH."k/www/".str_replace("http://","",$url.".html"),$htmlcode);
                $is_success = TRUE;
            }
        }
    }
    if (empty($bug_url)) {
        exit;
    }
    return $is_success;
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:63,代码来源:global_func.php

示例6: HtmlReplace

<?php

/*
	[kuaso!] (C)209-2010 Kuaso Inc.
	
	This is NOT a freeware, use is subject to license terms

	$Id: shoulu.php 2010-01-24 16:17:18Z anjel $
*/
require "../global.php";
$url = HtmlReplace($_GET["ref"]);
if ($url != $config["url"] && stristr($url, "http://")) {
    $url = GetSiteUrl($url);
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (empty($site)) {
        $array = array('url' => $url, 'spider_depth' => $config["spider_depth"], 'indexdate' => time(), 'addtime' => time());
        $db->insert("kuaso_sites", $array);
    }
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (!empty($site)) {
        $ip = ip();
        //$referer=$_SERVER['HTTP_REFERER'];
        $v = $db->get_one("select * from kuaso_stat_visitor where v_ip='" . $ip . "' and v_time>='" . (time() - 86400 * 1) . "'");
        if (empty($v)) {
            $array = array('v_time' => time(), 'v_ip' => $ip);
            $db->insert("kuaso_stat_visitor", $array);
            $db->query("update kuaso_sites set com_time='" . time() . "',com_count_ip=com_count_ip+1 where url='" . $url . "'");
        }
    }
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (!empty($site)) {
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:shoulu.php

示例7: add_links

function add_links($url, $is_index_page = true, $num = '')
{
    global $db;
    $new_links = array();
    $j = 1;
    $url_htmlcode = get_url_content($url);
    $url_htmlcode = get_encoding($url_htmlcode, "GB2312");
    $links = get_links($url_htmlcode, $url, 1, $url);
    echo "<br><b>url=";
    print_r($url);
    echo "<br></b>";
    if ($is_index_page) {
        foreach ($links as $value) {
            $new_links[] = GetSiteUrl($value);
        }
    } else {
        $new_links = $links;
    }
    $new_links = distinct_array($new_links);
    foreach ($new_links as $value) {
        //echo $value."<br>";
        //ob_flush();
        //flush();
        $query = $db->query("select * from ve123_links where url='{$value}'");
        $num = $db->num_rows($query);
        if ($num == 0) {
            echo "<font color=#C60A00><b>抓取到:</b></font>" . $value . "<br>";
            if (!add_update_link($value, "", "", "add")) {
                continue;
            }
            $j++;
            if (!empty($num)) {
                if ($j >= $num) {
                    exit;
                }
            }
        } else {
            echo "<b>已存在了:</b>";
            echo "<a href=" . $value . " target=_blank>" . $value . "</a>";
            echo "<br>";
        }
        ob_flush();
        flush();
    }
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:45,代码来源:links.php

示例8: IndexForumAddTopic

function IndexForumAddTopic()
{
    global $forum_lang;
    $forums_tree = ForumTree::Instance();
    // Проверки на доступ
    if (CheckGet('forum') && CheckPost('topic_title', 'text') && isset($forums_tree->IdCats[$_GET['forum']])) {
        $forum_id = SafeEnv($_GET['forum'], 11, int);
        $forum = $forums_tree->IdCats[$forum_id];
        $forum_config = $forums_tree->GetForumConfigRecursive($forum_id);
        if (!$forum_config['access']) {
            // Доступ
            System::site()->AddTextBox($forum_lang['error'], $forum_config['access_reason']);
            return;
        } elseif (!$forum_config['add_topic']) {
            // Разрешено ли добавлять новые темы
            System::site()->AddTextBox($forum_lang['error'], $forum_config['add_topic_reason']);
            return;
        }
    } else {
        System::site()->AddTextBox($forum_lang['error'], $forum_lang['error_data']);
        return;
    }
    if (!CheckPost('text') || strlen($_POST['text']) == 0) {
        System::site()->AddTextBox($forum_lang['error'], $forum_lang['no_data']);
        return;
    }
    $user_id = System::user()->Get('u_id');
    $user_name = System::user()->Get('u_name');
    $time = time();
    // Добавляем топик
    // TODO: Зачем здесь пустое поле?
    $uniq_code = '';
    //GenRandomString(12, '1234567890');
    $topic_title = SafeEnv($_POST['topic_title'], 255, str);
    if (strlen($topic_title) == 0) {
        System::site()->AddTextBox($forum_lang['error'], $forum_lang['no_title_topic']);
        return;
    }
    $topic_values = Values('', $forum_id, $topic_title, '1', '0', '0', $time, $user_id, $user_name, $time, '0', '', $uniq_code, 0, 0, 0);
    System::database()->Insert('forum_topics', $topic_values);
    $topic_id = System::database()->GetLastId();
    $topic = System::database()->Select('forum_topics', "`id`='{$topic_id}'");
    $topic = $topic[0];
    // Добавляем сообщение
    $email = System::user()->Get('u_email');
    $hideemail = System::user()->Get('u_hideemail');
    $site = System::user()->Get('u_homepage');
    $icq = System::user()->Get('u_icq');
    $text = SafeEnv($_POST['text'], 0, str);
    System::database()->Insert('forum_posts', Values('', $topic_id, $user_id, time(), $user_name, $site, $email, $hideemail, $icq, $text, getip(), 0));
    // Добавляем очков пользователю
    System::user()->ChargePoints(System::config('points/forum_post'));
    // Увеличиваем счётчик сообщений и тем пользователя
    ForumCalcUserCounters(1, 1);
    $forum['topics'] = SafeDB($forum['topics'], 11, int) + 1;
    IndexForumSetLastPostInfo($forum, $topic);
    // Добавляем метку о прочтении темы автором топика
    System::database()->Insert('forum_topics_read', Values($user_id, $topic_id, $time));
    // Очищаем кэш
    ForumCacheClear();
    GO(Ufu('index.php?name=forum&op=showforum&forum=' . $forum_id, GetSiteUrl() . 'forum/{forum}/'));
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:62,代码来源:addtopic.php

示例9: IndexGalleryView

function IndexGalleryView()
{
    if (isset($_GET['img'])) {
        $id = SafeEnv($_GET['img'], 11, int);
    } else {
        GO(GetSiteUrl() . Ufu('index.php?name=gallery', '{name}/'));
    }
    /*
     * Загружаем все изображения из категории и делаем массив соответствий index -> id, для определения следующего и
     * предыдущего изображения.
     */
    $cat = SafeEnv($_GET['cat'], 11, int);
    $db_images = System::database()->Select('gallery', GetWhereByAccess('view', "`cat_id`='{$cat}' and `show`='1'"), null, 'order');
    if (System::database()->NumRows() == 0) {
        GO(GetSiteUrl() . Ufu('index.php?name=gallery', '{name}/'));
    }
    $images = array();
    foreach ($db_images as $k => $img) {
        $images[$k] = $img['id'];
    }
    /*
     * Текущее изображение.
     */
    $index = array_search($id, $images);
    if ($index !== false) {
        $img = $db_images[$index];
    } else {
        GO(GetSiteUrl() . Ufu('index.php?name=gallery', '{name}/'));
    }
    /*
     * Добавляем блок изображения в шаблонизатор, блок будет содержать ссылки на следующее и предыдущее изображение.
     */
    $vars = IndexGalleryFilterImageData($img, $index + 1, count($db_images));
    $vars['next'] = isset($db_images[$index + 1]);
    if ($vars['next']) {
        $nimg = $db_images[$index + 1];
        $vars['next_url'] = Ufu('index.php?name=gallery&op=view&img=' . SafeDB($nimg['id'], 11, int) . '&cat=' . SafeDB($nimg['cat_id'], 11, int), 'gallery/{cat}/{img}/');
        $vars['next_title'] = SafeDB($nimg['title'], 255, str);
    }
    $vars['prev'] = isset($db_images[$index - 1]);
    if ($vars['prev']) {
        $nimg = $db_images[$index - 1];
        $vars['prev_url'] = Ufu('index.php?name=gallery&op=view&img=' . SafeDB($nimg['id'], 11, int) . '&cat=' . SafeDB($nimg['cat_id'], 11, int), 'gallery/{cat}/{img}/');
        $vars['prev_title'] = SafeDB($nimg['title'], 255, str);
    }
    if ($vars['title'] == '') {
        $vars['title'] = 'Изображение ' . strval($index + 1);
    }
    $GalleryImageBlock = System::site()->NewBlock('gallery_image', true, false, 'img')->SetVars($vars);
    /*
     * Выводим изображения в категории.
     */
    IndexGalleryShow($cat, $db_images, true, $GalleryImageBlock, $index);
    /*
     * Хлебные крошки, заголовок окна, подключение шаблона.
     */
    IndexGalleryGetTree()->BreadCrumbs($cat);
    System::site()->BreadCrumbAdd($vars['title']);
    System::site()->SetTitle($vars['title']);
    System::site()->AddTemplatedBox('', 'module/gallery_view.html');
    /*
     * Увеличиваем счётчик просмотров.
     */
    System::database()->Update('gallery', "`hits`='" . ($img['hits'] + 1) . "'", "`id`='{$id}'");
    /*
     * Выводим комментарии.
     */
    if (isset($_GET['page'])) {
        $page = SafeEnv($_GET['page'], 11, int);
    } else {
        $page = 0;
    }
    $posts = new Posts('gallery_comments', $img['allow_comments'] == '1');
    $posts->EditPageUrl = 'index.php?name=gallery&op=editpost&img=' . $id;
    $posts->DeletePageUrl = 'index.php?name=gallery&op=deletepost&img=' . $id;
    $posts->PostFormAction = "index.php?name=gallery&op=addpost&img={$id}&cat={$cat}&page={$page}";
    $posts->NavigationUrl = Ufu("index.php?name=gallery&op=view&img={$id}&cat={$cat}", 'gallery/{cat}/{img}/page{page}/', true);
    $posts->RenderPosts($id, 'gallery_comments', 'comments_navigation', false, $page);
    $posts->RenderForm(false, 'gallery_comments_form');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:80,代码来源:index.php

示例10: header

<?php

/*
 * LinkorCMS 1.4
 * © 2012 LinkorCMS Development Group
 */
if (!defined('VALID_RUN')) {
    header("HTTP/1.1 404 Not Found");
    exit;
}
define('FORMS_UFU', GetSiteUrl() . Ufu('index.php?name=forms', 'system:mod'));
System::site()->SetTitle('Web-формы');
include_once System::config('inc_dir') . 'forms.inc.php';
if (!isset($_GET['op'])) {
    $op = 'main';
} else {
    $op = $_GET['op'];
}
if (isset($_GET['form'])) {
    $id = SafeEnv($_GET['form'], 11, int);
    $form = System::database()->SelectOne('forms', "`id`='{$id}' && `active`='1'");
    if ($form === false) {
        GO(FORMS_UFU);
    }
} elseif (isset($_GET['formlink'])) {
    $link = SafeEnv(Utf8ToCp1251(rawurldecode($_GET['formlink'])), 255, str);
    $form = System::database()->SelectOne('forms', "`link`='{$link}' && `active`='1'");
    if ($form === false) {
        GO(FORMS_UFU);
    }
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:31,代码来源:index.php

示例11: IndexGBAddMsgSave

function IndexGBAddMsgSave()
{
    $r = array();
    $er = array();
    if (!isset($_GET['name']) || !isset($_POST['email']) || !isset($_POST['site']) || !isset($_POST['icq']) || !isset($_POST['text'])) {
        $er[] = 'Данные не инициализированы.';
    }
    if (GBCheckFlood()) {
        $er[] = 'Флуд защита, подождите немного.';
    }
    if (strlen($_POST['name']) == 0) {
        $er[] = 'Вы не ввели имя.';
    }
    if (strlen($_POST['email']) == 0) {
        $er[] = 'Вы не ввели свой e-mail.';
    } elseif (!CheckEmail($_POST['email'])) {
        $er[] = 'Вы совершили ошибку при вводе e-mail.';
    }
    if (strlen($_POST['text']) == 0) {
        $er[] = 'Вы не ввели текст сообщения, либо сообщение слишком короткое.';
    }
    if ($_POST['icq'] != '') {
        if (!is_numeric($_POST['icq'])) {
            $er[] = 'Ваш номер ICQ должен состоять только из чисел.';
        }
    }
    // Проверяем капчу
    if (!System::user()->Auth || !System::user()->isAdmin() && System::config('gb/show_captcha')) {
        if (!System::user()->isDef('captcha_keystring') || System::user()->Get('captcha_keystring') != $_POST['keystr']) {
            $er[] = 'Вы ошиблись при вводе кода с картинки.';
        }
    }
    if (count($er) == 0) {
        if (isset($_POST['hideemail'])) {
            $hideemail = '1';
        } else {
            $hideemail = '0';
        }
        if (System::user()->isAdmin() || !System::config('gb/moderation')) {
            $moderated = 1;
        } else {
            $moderated = 0;
        }
        $name = SafeEnv($_POST['name'], 50, str, true);
        $email = SafeEnv($_POST['email'], 50, str, true);
        $_site = SafeEnv(Url($_POST['site']), 250, str, true);
        $icq = SafeEnv($_POST['icq'], 15, str, true);
        $text = SafeEnv($_POST['text'], System::config('gb/msgmaxlen'), str, true);
        $vals = Values('', $name, $email, $hideemail, $_site, $icq, $text, '', time(), getip(), $moderated);
        System::database()->Insert('guestbook', $vals);
        System::user()->ChargePoints(System::config('points/gb_public'));
        if (System::user()->isAdmin() || !System::config('gb/moderation')) {
            GO(GetSiteUrl() . Ufu('index.php?name=guestbook', '{name}/'));
        } else {
            $text = '<p align="center"><br>Спасибо! Ваше сообщение будет добавлено после модерации.<br><br>';
            $text .= '<input type="button" value="Назад" onclick="history.back();"><br></p>';
            System::site()->AddTextBox('', $text);
        }
    } else {
        $text = 'Ваше сообщение не добавлено по следующим причинам:<br><ul>';
        foreach ($er as $error) {
            $text .= '<li>' . $error;
        }
        $text .= '</ul><p align="center"><input type="button" value="Назад" onclick="history.back();"></p>';
        System::site()->AddTextBox('', $text);
    }
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:67,代码来源:index.php

示例12: IndexArticlesRead

function IndexArticlesRead()
{
    if (isset($_GET['art'])) {
        $id = SafeEnv($_GET['art'], 11, int);
    } else {
        GO(GetSiteUrl() . Ufu('index.php?name=articles', '{name}/'));
    }
    $where = "`id`='{$id}' and `active`='1'";
    System::database()->Select('articles', GetWhereByAccess('view', $where));
    if (System::database()->NumRows() == 0) {
        GO(GetSiteUrl() . Ufu('index.php?name=articles', '{name}/'));
    }
    $art = System::database()->FetchRow();
    System::database()->Update('articles', "hits='" . (SafeEnv($art['hits'], 11, int) + 1) . "'", $where);
    $cat = SafeDB($art['cat_id'], 11, int);
    // Показываем путь
    if (System::config('articles/show_catnav') == '1') {
        IndexArticlesGetTree()->BreadCrumbs($art['cat_id']);
    }
    System::site()->BreadCrumbAdd(SafeDB($art['title'], 255, str));
    System::site()->AddTemplatedBox('', 'module/article_read.html');
    System::site()->SetTitle(SafeDB($art['title'], 255, str));
    System::site()->SeoTitle = SafeDB($art['seo_title'], 255, str);
    System::site()->SeoKeyWords = SafeDB($art['seo_keywords'], 255, str);
    System::site()->SeoDescription = SafeDB($art['seo_description'], 255, str);
    RenderReadArticle($art);
    // Выводим комментарии
    if (isset($_GET['page'])) {
        $page = SafeEnv($_GET['page'], 11, int);
    } else {
        $page = 0;
    }
    $posts = new Posts('articles_comments', $art['allow_comments'] == '1');
    $posts->EditPageUrl = "index.php?name=articles&op=editpost&art={$id}";
    // Форма редактирования поста
    $posts->DeletePageUrl = "index.php?name=articles&op=deletepost&art={$id}";
    // Удаление поста
    $posts->PostFormAction = "index.php?name=articles&op=addpost&art={$id}&cat={$cat}";
    // Добавление поста (сохранение)
    $posts->NavigationUrl = Ufu("index.php?name=articles&op=read&art={$id}&cat={$cat}", 'articles/{cat}/{art}/page{page}/', true);
    $posts->NavigationAnchor = '#comments';
    $posts->RenderPosts($id, 'article_comments', 'comments_navigation', false, $page);
    $posts->RenderForm(false, 'article_comments_form');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:44,代码来源:index.php

示例13: set_time_limit

<link rel="stylesheet" href="xp.css" type="text/css">
<?php 
set_time_limit(0);
//error_reporting(0);
require "global.php";
echo "正在检查网址中...<br>";
print str_repeat(" ", 4096);
ob_flush();
flush();
sleep(1);
$url = $_GET["url"];
if (empty($url)) {
    echo tips("网址不能为空!");
    die;
}
insert_links($url);
GetUrl_AllSite(GetSiteUrl($url));
$db->close();
开发者ID:tanny2015,项目名称:DataStructure,代码行数:18,代码来源:insert_link.php

示例14: IndexDownloadsFull

function IndexDownloadsFull()
{
    if (isset($_GET['file'])) {
        $id = SafeEnv($_GET['file'], 11, int);
    } else {
        GO(GetSiteUrl() . Ufu('index.php?name=downloads', '{name}/'));
    }
    System::database()->Select('downloads', GetWhereByAccess('view', "`id`='{$id}' and `active`='1'"));
    if (System::database()->NumRows() == 0) {
        GO(GetSiteUrl() . Ufu('index.php?name=downloads', '{name}/'));
    }
    $file = System::database()->FetchRow();
    $cat = SafeDB($file['category'], 11, int);
    IndexDownloadsGetTree()->BreadCrumbs($cat);
    System::site()->BreadCrumbAdd(SafeDB($file['title'], 255, str));
    System::site()->SetTitle('Скачать ' . SafeDB($file['title'], 255, str));
    System::site()->AddTemplatedBox('', 'module/download_full.html');
    AddDetailDownload($file);
    // Выводим комментарии
    if (isset($_GET['page'])) {
        $page = SafeEnv($_GET['page'], 11, int);
    } else {
        $page = 0;
    }
    include_once System::config('inc_dir') . 'posts.class.php';
    $posts = new Posts('downloads_comments', $file['allow_comments'] == '1');
    $posts->EditPageUrl = "index.php?name=downloads&op=editpost&file={$id}";
    // Форма редактирования поста
    $posts->DeletePageUrl = "index.php?name=downloads&op=deletepost&file={$id}";
    // Удаление поста
    $posts->PostFormAction = "index.php?name=downloads&op=addpost&file={$id}&cat={$cat}&page={$page}";
    // Добавление поста (сохранение)
    $posts->NavigationUrl = Ufu("index.php?name=downloads&op=full&file={$id}&cat={$cat}", 'downloads/{cat}/{file}/page{page}/', true);
    $posts->NavigationAnchor = '#comments';
    $posts->RenderPosts($id, 'download_comments', 'comments_navigation', false, $page);
    $posts->RenderForm(false, 'download_comments_form');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:37,代码来源:index.php

示例15: SetPage

 /**
  * Устанавливает переменные страницы
  * @return void
  */
 protected function SetPage()
 {
     $this->AddVars('head', array('doctype' => $this->Doctype, 'title' => HtmlChars($this->GenerateTitle()), 'meta' => $this->GenerateMetaTags(), 'text' => $this->GenerateHead(), 'body_params' => $this->BodyParams, 'base' => GetSiteUrl()));
 }
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:8,代码来源:page_template.class.php


注:本文中的GetSiteUrl函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。