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


PHP url_encode_rewrite函数代码示例

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


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

示例1: rewrite_field

 function rewrite_field($field)
 {
     $field = strtolower($field);
     $field = url_encode_rewrite($field);
     $field = str_replace('-', '_', $field);
     return 'f_' . $field;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:7,代码来源:admin_extend_field_add.php

示例2: faq_mini

function faq_mini($position, $block)
{
    global $Cache, $Template, $FAQ_LANG, $FAQ_CATS, $RANDOM_QUESTIONS;
    load_module_lang('faq');
    $Cache->load('faq');
    include_once PATH_TO_ROOT . '/faq/faq_begin.php';
    include_once PATH_TO_ROOT . '/faq/faq_cats.class.php';
    $tpl = new Template('faq/faq_mini.tpl');
    import('core/menu_service');
    MenuService::assign_positions_conditions($tpl, $block);
    $no_random_question = array('L_FAQ_RANDOM_QUESTION' => $FAQ_LANG['random_question'], 'FAQ_QUESTION' => $FAQ_LANG['no_random_question'], 'U_FAQ_QUESTION' => TPL_PATH_TO_ROOT . '/faq/' . url('faq.php'));
    if (empty($RANDOM_QUESTIONS)) {
        $tpl->assign_vars($no_random_question);
        return $tpl->parse(TEMPLATE_STRING_MODE);
    }
    $random_question = $RANDOM_QUESTIONS[array_rand($RANDOM_QUESTIONS)];
    $faq_cats = new FaqCats();
    $i = 0;
    while (!$faq_cats->check_auth($random_question['idcat']) && $i < 5) {
        $random_question = $RANDOM_QUESTIONS[array_rand($RANDOM_QUESTIONS)];
        $i++;
    }
    if ($i < 5 && !empty($random_question['question'])) {
        $tpl->assign_vars(array('L_FAQ_RANDOM_QUESTION' => $FAQ_LANG['random_question'], 'FAQ_QUESTION' => $random_question['question'], 'U_FAQ_QUESTION' => PATH_TO_ROOT . '/faq/' . ($random_question['idcat'] > 0 ? url('faq.php?id=' . $random_question['idcat'] . '&amp;question=' . $random_question['id'], 'faq-' . $random_question['idcat'] . '+' . url_encode_rewrite($FAQ_CATS[$random_question['idcat']]['name']) . '.php?question=' . $random_question['id']) . '#q' . $random_question['id'] : url('faq.php?question=' . $random_question['id'], 'faq.php?question=' . $random_question['id']) . '#q' . $random_question['id'])));
    } else {
        $tpl->assign_vars($no_random_question);
    }
    return $tpl->parse(TEMPLATE_STRING_MODE);
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:29,代码来源:faq_mini.php

示例3: wiki_display_menu

function wiki_display_menu($menu_list)
{
    if (count($menu_list) == 0) {
        return '';
    }
    $menu = '';
    $last_level = 0;
    foreach ($menu_list as $title) {
        $current_level = $title[0];
        $title_name = stripslashes($title[1]);
        $title_link = '<a href="#paragraph_' . url_encode_rewrite($title_name) . '">' . htmlspecialchars($title_name, ENT_COMPAT, 'ISO-8859-1') . '</a>';
        if ($current_level > $last_level) {
            $menu .= '<ol class="wiki_list_' . $current_level . '"><li>' . $title_link;
        } elseif ($current_level == $last_level) {
            $menu .= '</li><li>' . $title_link;
        } else {
            if (substr($menu, strlen($menu) - 4, 4) == '<li>') {
                $menu = substr($menu, 0, strlen($menu) - 4);
            }
            $menu .= str_repeat('</li></ol>', $last_level - $current_level) . '</li><li>' . $title_link;
        }
        $last_level = $title[0];
    }
    if (substr($menu, strlen($menu) - 4, 4) == '<li>') {
        $menu = substr($menu, 0, strlen($menu) - 4);
    }
    $menu .= str_repeat('</li></ol>', $last_level);
    return $menu;
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:29,代码来源:wiki_functions.php

示例4: bread_crumb

function bread_crumb($id)
{
    global $Bread_crumb, $MEDIA_CATS;
    $id_parent = $MEDIA_CATS[$id]['id_parent'];
    $Bread_crumb->add($MEDIA_CATS[$id]['name'], url('media.php?cat=' . $id, 'media-0-' . $id . '+' . url_encode_rewrite($MEDIA_CATS[$id]['name']) . '.php'));
    while ($id_parent >= 0) {
        $Bread_crumb->add($MEDIA_CATS[$id_parent]['name'], url('media.php?cat=' . $id_parent, 'media-0-' . $id_parent . '+' . url_encode_rewrite($MEDIA_CATS[$id_parent]['name']) . '.php'));
        $id_parent = $MEDIA_CATS[$id_parent]['id_parent'];
    }
    $Bread_crumb->reverse();
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:11,代码来源:media_begin.php

示例5: get_feed_data_struct

 function get_feed_data_struct($idcat = 0)
 {
     global $Cache, $Sql, $LANG, $MEDIA_LANG, $CONFIG, $MEDIA_CONFIG, $MEDIA_CATS;
     $Cache->load('media');
     load_module_lang('media');
     require_once PATH_TO_ROOT . '/media/media_constant.php';
     require_once PATH_TO_ROOT . '/media/media_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     $data = new FeedData();
     $data->set_title($MEDIA_LANG['xml_media_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=media&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($MEDIA_LANG['xml_media_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(MEDIA_AUTH_READ);
     $cats = new MediaCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $result = $Sql->query_while("SELECT id, idcat, name, contents, timestamp FROM " . PREFIX . "media WHERE infos = '" . MEDIA_STATUS_APROBED . "' AND idcat IN (" . implode($children_cats, ',') . " ) ORDER BY timestamp DESC" . $Sql->limit(0, $MEDIA_CONFIG['pagin']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/media/media' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php'));
         $item->set_title($row['name']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($MEDIA_CATS[$row['idcat']]['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], MEDIA_AUTH_READ, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:37,代码来源:media_interface.class.php

示例6: ucfirst

            }
            $last_topic_title = ($CONFIG_FORUM['activ_display_msg'] && $row['display_msg'] ? $CONFIG_FORUM['display_msg'] : '') . ' ' . ucfirst($row['title']);
            $last_topic_title = strlen(html_entity_decode($last_topic_title, ENT_COMPAT, 'ISO-8859-1')) > 20 ? substr_html($last_topic_title, 0, 20) . '...' : $last_topic_title;
            $row['login'] = !empty($row['login']) ? $row['login'] : $LANG['guest'];
            $last = '<a href="topic' . url('.php?id=' . $row['tid'], '-' . $row['tid'] . '+' . url_encode_rewrite($row['title']) . '.php') . '" class="small_link">' . $last_topic_title . '</a><br />
			<a href="topic' . url('.php?' . $last_page . 'id=' . $row['tid'], '-' . $row['tid'] . $last_page_rewrite . '+' . url_encode_rewrite($row['title']) . '.php') . '#m' . $last_msg_id . '"><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a> ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['last_timestamp']) . '<br />' . $LANG['by'] . ' ' . ($row['last_user_id'] != '-1' ? '<a href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '" class="small_link">' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>');
        } else {
            $row['last_timestamp'] = '';
            $last = '<br />' . $LANG['no_message'] . '<br /><br />';
        }
        $img_announce = 'announce';
        if (!$is_guest) {
            if ($row['last_view_id'] != $row['last_msg_id'] && $row['last_timestamp'] >= $max_time_msg) {
                $img_announce = 'new_' . $img_announce;
            }
        }
        $img_announce .= $row['status'] == '0' ? '_lock' : '';
        $total_topic += $row['nbr_topic'];
        $total_msg += $row['nbr_msg'];
        $Template->assign_block_vars('forums_list.subcats', array('IMG_ANNOUNCE' => $img_announce, 'NAME' => $row['name'], 'DESC' => second_parse($row['subname']), 'SUBFORUMS' => !empty($subforums) && !empty($row['subname']) ? '<br />' . $subforums : $subforums, 'NBR_TOPIC' => $row['nbr_topic'], 'NBR_MSG' => $row['nbr_msg'], 'U_FORUM_URL' => $row['url'], 'U_FORUM_VARS' => url('.php?id=' . $row['cid'], '-' . $row['cid'] . '+' . url_encode_rewrite($row['name']) . '.php'), 'U_LAST_TOPIC' => $last));
    }
}
$Sql->query_close($result);
if ($i > 0) {
    $Template->assign_block_vars('forums_list', array());
    $Template->assign_block_vars('forums_list.endcats', array());
}
list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script LIKE '/forum/%'");
$Template->assign_vars(array('FORUM_NAME' => $CONFIG_FORUM['forum_name'], 'NBR_MSG' => $total_msg, 'NBR_TOPIC' => $total_topic, 'TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'SELECT_CAT' => !empty($id_get) ? forum_list_cat($id_get, 0) : '', 'C_TOTAL_POST' => true, 'U_ONCHANGE' => url(".php?id=' + this.options[this.selectedIndex].value + '", "-' + this.options[this.selectedIndex].value + '.php"), 'U_ONCHANGE_CAT' => url("index.php?id=' + this.options[this.selectedIndex].value + '", "cat-' + this.options[this.selectedIndex].value + '.php"), 'L_SEARCH' => $LANG['search'], 'L_ADVANCED_SEARCH' => $LANG['advanced_search'], 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_FORUM' => $LANG['forum'], 'L_TOPIC' => $total_topic > 1 ? $LANG['topic_s'] : $LANG['topic'], 'L_MESSAGE' => $total_msg > 1 ? $LANG['message_s'] : $LANG['message'], 'L_LAST_MESSAGE' => $LANG['last_message'], 'L_STATS' => $LANG['stats'], 'L_DISPLAY_UNREAD_MSG' => $LANG['show_not_reads'], 'L_MARK_AS_READ' => $LANG['mark_as_read'], 'L_TOTAL_POST' => $LANG['nbr_message'], 'L_DISTRIBUTED' => strtolower($LANG['distributed']), 'L_AND' => $LANG['and'], 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
$Template->pparse('forum_index');
include '../kernel/footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:index.php

示例7: COUNT

if (!$User->check_level(MEMBER_LEVEL)) {
    $Errorh->handler('e_auth', E_USER_REDIRECT);
}
$Template->set_filenames(array('forum_alert' => 'forum/forum_alert.tpl', 'forum_top' => 'forum/forum_top.tpl', 'forum_bottom' => 'forum/forum_bottom.tpl'));
if (!empty($alert) && empty($alert_post)) {
    $nbr_alert = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "forum_alerts WHERE idtopic = '" . $alert . "' AND status = 0", __LINE__, __FILE__);
    if (empty($nbr_alert)) {
        $Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'L_ALERT' => $LANG['alert_topic'], 'L_ALERT_EXPLAIN' => $LANG['alert_modo_explain'], 'L_ALERT_TITLE' => $LANG['alert_title'], 'L_ALERT_CONTENTS' => $LANG['alert_contents'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_REQUIRE_TITLE' => $LANG['require_title']));
        $Template->assign_block_vars('alert_form', array('TITLE' => $topic_name, 'U_TOPIC' => 'topic' . url('.php?id=' . $alert, '-' . $alert . '-' . url_encode_rewrite($topic_name) . '.php'), 'ID_ALERT' => $alert));
    } else {
        $Template->assign_vars(array('L_ALERT' => $LANG['alert_topic'], 'L_BACK_TOPIC' => $LANG['alert_back'], 'URL_TOPIC' => 'topic' . url('.php?id=' . $alert, '-' . $alert . '-' . url_encode_rewrite($topic_name) . '.php')));
        $Template->assign_block_vars('alert_confirm', array('MSG' => $LANG['alert_topic_already_done']));
    }
}
if (!empty($alert_post)) {
    $Template->assign_vars(array('L_ALERT' => $LANG['alert_topic'], 'L_BACK_TOPIC' => $LANG['alert_back'], 'URL_TOPIC' => 'topic' . url('.php?id=' . $alert_post, '-' . $alert_post . '-' . url_encode_rewrite($topic_name) . '.php')));
    $nbr_alert = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "forum_alerts WHERE idtopic = '" . $alert_post . "' AND status = 0", __LINE__, __FILE__);
    if (empty($nbr_alert)) {
        $alert_title = retrieve(POST, 'title', '');
        $alert_contents = retrieve(POST, 'contents', '', TSTRING_PARSE);
        include_once '../forum/forum.class.php';
        $Forumfct = new Forum();
        $Forumfct->Alert_topic($alert_post, $alert_title, $alert_contents);
        $Template->assign_block_vars('alert_confirm', array('MSG' => str_replace('%title', $topic_name, $LANG['alert_success'])));
    } else {
        $Template->assign_block_vars('alert_confirm', array('MSG' => $LANG['alert_topic_already_done']));
    }
}
list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/%'");
$Template->assign_vars(array('FORUM_NAME' => $CONFIG_FORUM['forum_name'] . ' : ' . $LANG['alert_topic'], 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'DESC' => $topic['subtitle'], 'TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'U_FORUM_CAT' => '<a href="forum' . url('.php?id=' . $topic['idcat'], '-' . $topic['idcat'] . '.php') . '">' . $CAT_FORUM[$topic['idcat']]['name'] . '</a>', 'U_TITLE_T' => '<a href="topic' . url('.php?id=' . $topic_id, '-' . $topic_id . '.php') . '">' . $topic['title'] . '</a>', 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
$Template->pparse('forum_alert');
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:alert.php

示例8: IN

        $auth_cats = !empty($auth_cats) ? " AND c.id NOT IN (" . trim($auth_cats, ',') . ")" : '';
        $result = $Sql->query_while("\n\t\tSELECT ta.id, ta.title, ta.timestamp, ta.status, ta.user_id, ta.idtopic, ta.idmodo, m2.login AS login_modo, m.login, t.title AS topic_title, t.idcat, c.id AS cid, ta.contents\n\t\tFROM " . PREFIX . "forum_alerts ta\n\t\tLEFT JOIN " . PREFIX . "forum_topics t ON t.id = ta.idtopic\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = ta.user_id\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m2 ON m2.user_id = ta.idmodo\n\t\tLEFT JOIN " . PREFIX . "forum_cats c ON c.id = t.idcat\n\t\tWHERE ta.id = '" . $id_get . "'" . $auth_cats, __LINE__, __FILE__);
        $row = $Sql->fetch_assoc($result);
        if (!empty($row)) {
            if (empty($row['idcat'])) {
                include_once '../forum/forum.class.php';
                $Forumfct = new Forum();
                $Forumfct->Del_alert_topic($id_get);
                redirect(HOST . DIR . '/forum/moderation_forum' . url('.php?action=alert', '', '&'));
            }
            if ($row['status'] == 0) {
                $status = $LANG['alert_not_solved'];
            } else {
                $status = $LANG['alert_solved'] . '<a href="../member/member' . url('.php?id=' . $row['idmodo'], '-' . $row['idmodo'] . '.php') . '">' . $row['login_modo'] . '</a>';
            }
            $Template->assign_vars(array('ID' => $id_get, 'TITLE' => $row['title'], 'TOPIC' => '<a href="topic' . url('.php?id=' . $row['idtopic'], '-' . $row['idtopic'] . '+' . url_encode_rewrite($row['topic_title']) . '.php') . '">' . $row['topic_title'] . '</a>', 'CONTENTS' => second_parse($row['contents']), 'STATUS' => $status, 'LOGIN' => '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>', 'TIME' => gmdate_format('date_format', $row['timestamp']), 'CAT' => '<a href="forum' . url('.php?id=' . $row['idcat'], '-' . $row['idcat'] . '+' . url_encode_rewrite($CAT_FORUM[$row['idcat']]['name']) . '.php') . '">' . $CAT_FORUM[$row['idcat']]['name'] . '</a>', 'C_FORUM_ALERT_LIST' => true, 'U_CHANGE_STATUS' => $row['status'] == '0' ? 'moderation_forum.php' . url('?action=alert&amp;id=' . $id_get . '&amp;new_status=1&amp;token=' . $Session->get_token()) : 'moderation_forum.php' . url('?action=alert&amp;id=' . $id_get . '&amp;new_status=0&amp;token=' . $Session->get_token()), 'L_CHANGE_STATUS' => $row['status'] == '0' ? $LANG['change_status_to_1'] : $LANG['change_status_to_0'], 'L_TITLE' => $LANG['alert_title'], 'L_TOPIC' => $LANG['alert_concerned_topic'], 'L_CONTENTS' => $LANG['alert_msg'], 'L_LOGIN' => $LANG['alert_login'], 'L_TIME' => $LANG['date'], 'L_STATUS' => $LANG['status'], 'L_STATUS_1' => $LANG['change_status_to_1'], 'L_CAT' => $LANG['alert_concerned_cat']));
        } else {
            $Template->assign_vars(array('C_FORUM_ALERT_NOT_AUTH' => true, 'L_NO_ALERT' => $LANG['alert_not_auth']));
        }
    }
} elseif ($action == 'punish') {
    $readonly = retrieve(POST, 'new_info', 0);
    $readonly = $readonly > 0 ? time() + $readonly : 0;
    $readonly_contents = retrieve(POST, 'action_contents', '', TSTRING_UNCHANGE);
    if (!empty($id_get) && retrieve(POST, 'valid_user', false)) {
        $info_mbr = $Sql->query_array(DB_TABLE_MEMBER, 'user_id', 'level', "WHERE user_id = '" . $id_get . "'", __LINE__, __FILE__);
        if (!empty($info_mbr['user_id']) && ($info_mbr['level'] < 2 || $User->check_level(ADMIN_LEVEL))) {
            $Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET user_readonly = '" . $readonly . "' WHERE user_id = '" . $info_mbr['user_id'] . "'", __LINE__, __FILE__);
            if ($info_mbr['user_id'] != $User->get_attribute('user_id')) {
                if (!empty($readonly_contents) && !empty($readonly)) {
                    import('members/pm');
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:moderation_forum.php

示例9: redirect

        redirect(HOST . DIR . '/pages/pages.php?error=e_auth');
    }
    if ($id_redirection > 0) {
        $Bread_crumb->add($LANG['pages_redirection_management'], url('action.php?id=' . $id_redirection));
    } elseif ($id_new > 0) {
        $Bread_crumb->add($LANG['pages_creation_redirection'], url('action.php?new=' . $id_redirection));
    } elseif ($del_cat > 0) {
        $Bread_crumb->add($LANG['pages_delete_cat'], url('action.php?del_cat=' . $id_redirection));
    } else {
        $Bread_crumb->add($LANG['pages_rename'], url('action.php?rename=' . $id_rename));
    }
    $Bread_crumb->add($page_infos['title'], url('pages.php?title=' . $page_infos['encoded_title'], $page_infos['encoded_title']));
    $id = $page_infos['id_cat'];
    while ($id > 0) {
        if (empty($_PAGES_CATS[$id]['auth']) || $User->check_auth($_PAGES_CATS[$id]['auth'], READ_PAGE)) {
            $Bread_crumb->add($_PAGES_CATS[$id]['name'], url('pages.php?title=' . url_encode_rewrite($_PAGES_CATS[$id]['name']), url_encode_rewrite($_PAGES_CATS[$id]['name'])));
        }
        $id = (int) $_PAGES_CATS[$id]['id_parent'];
    }
    if ($User->check_auth($_PAGES_CONFIG['auth'], EDIT_PAGE)) {
        $Bread_crumb->add($LANG['pages'], url('pages.php'));
    }
    $Bread_crumb->reverse();
} else {
    $Bread_crumb->add($LANG['pages'], url('pages.php'), $LANG['pages_redirections'], url('action.php'));
}
require_once '../kernel/header.php';
$Template->set_filenames(array('pages_action' => 'pages/action.tpl'));
if ($del_cat > 0) {
    $page_infos = $Sql->query_array(PREFIX . 'pages', 'id', 'title', 'encoded_title', 'auth', 'id_cat', 'redirect', "WHERE id = '" . $del_cat . "'", __LINE__, __FILE__);
    $special_auth = !empty($page_infos['auth']);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:action.php

示例10: get_home_page

 function get_home_page()
 {
     global $Sql, $User, $Template, $Cache, $Bread_crumb, $_WIKI_CONFIG, $_WIKI_CATS, $LANG;
     load_module_lang('wiki');
     include_once '../wiki/wiki_functions.php';
     $bread_crumb_key = 'wiki';
     require_once '../wiki/wiki_bread_crumb.php';
     unset($Template);
     $Template = new Template();
     $Template->set_filenames(array('wiki' => 'wiki/wiki.tpl', 'index' => 'wiki/index.tpl'));
     $Template->assign_vars(array('WIKI_PATH' => $Template->get_module_data_path('wiki')));
     if ($_WIKI_CONFIG['last_articles'] > 1) {
         $result = $Sql->query_while("SELECT a.title, a.encoded_title, a.id\n\t\t\tFROM " . PREFIX . "wiki_articles a\n\t\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\n\t\t\tWHERE a.redirect = 0\n\t\t\tORDER BY c.timestamp DESC\n\t\t\tLIMIT 0, " . $_WIKI_CONFIG['last_articles'], __LINE__, __FILE__);
         $articles_number = $Sql->num_rows($result, "SELECT COUNT(*) FROM " . PREFIX . "wiki_articles WHERE encoded_title = '" . $encoded_title . "'", __LINE__, __FILE__);
         $Template->assign_block_vars('last_articles', array('L_ARTICLES' => $LANG['wiki_last_articles_list'], 'RSS' => $articles_number > 0 ? '<a href="{PATH_TO_ROOT}/syndication.php?m=wiki"><img src="../templates/' . get_utheme() . '/images/rss.png" alt="RSS" /></a>' : ''));
         $i = 0;
         while ($row = $Sql->fetch_assoc($result)) {
             $Template->assign_block_vars('last_articles.list', array('ARTICLE' => $row['title'], 'TR' => $i > 0 && $i % 2 == 0 ? '</tr><tr>' : '', 'U_ARTICLE' => url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title'])));
             $i++;
         }
         if ($articles_number == 0) {
             $Template->assign_vars(array('L_NO_ARTICLE' => '<td style="text-align:center;" class="row2">' . $LANG['wiki_no_article'] . '</td>'));
         }
     }
     if ($_WIKI_CONFIG['display_cats'] != 0) {
         $Template->assign_block_vars('cat_list', array('L_CATS' => $LANG['wiki_cats_list']));
         $i = 0;
         foreach ($_WIKI_CATS as $id => $infos) {
             if ($infos['id_parent'] == 0) {
                 $Template->assign_block_vars('cat_list.list', array('CAT' => $infos['name'], 'U_CAT' => url('wiki.php?title=' . url_encode_rewrite($infos['name']), url_encode_rewrite($infos['name']))));
                 $i++;
             }
         }
         if ($i == 0) {
             $Template->assign_vars(array('L_NO_CAT' => $LANG['wiki_no_cat']));
         }
     }
     $Template->assign_vars(array('TITLE' => !empty($_WIKI_CONFIG['wiki_name']) ? $_WIKI_CONFIG['wiki_name'] : $LANG['wiki'], 'INDEX_TEXT' => !empty($_WIKI_CONFIG['index_text']) ? second_parse(wiki_no_rewrite($_WIKI_CONFIG['index_text'])) : $LANG['wiki_empty_index'], 'L_EXPLORER' => $LANG['wiki_explorer'], 'U_EXPLORER' => url('explorer.php'), 'WIKI_PATH' => $Template->get_module_data_path('wiki')));
     $page_type = 'index';
     include '../wiki/wiki_tools.php';
     $tmp = $Template->pparse('wiki', TRUE);
     return $tmp;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:43,代码来源:wiki_interface.class.php

示例11: retrieve

<?php

require_once '../kernel/begin.php';
require_once 'download_auth.php';
$idurl = retrieve(GET, 'id', 0);
if (!empty($idurl)) {
    $Sql->query_inject("UPDATE " . PREFIX . "download SET count = count + 1 WHERE id = '" . $idurl . "'", __LINE__, __FILE__);
    $info_file = $Sql->query_array(PREFIX . "download", "url", "force_download", "idcat", "size", "WHERE id = '" . $idurl . "'", __LINE__, __FILE__);
    $Cache->load('download');
    $auth_read = $User->check_auth($CONFIG_DOWNLOAD['global_auth'], DOWNLOAD_READ_CAT_AUTH_BIT);
    $id_cat_for_download = (int) $info_file['idcat'];
    while ($id_cat_for_download > 0) {
        $Bread_crumb->add($DOWNLOAD_CATS[$id_cat_for_download]['name'], url('download.php?cat=' . $id_cat_for_download, 'category-' . $id_cat_for_download . '+' . url_encode_rewrite($DOWNLOAD_CATS[$id_cat_for_download]['name']) . '.php'));
        if (!empty($DOWNLOAD_CATS[$id_cat_for_download]['auth'])) {
            $auth_read = $auth_read && $User->check_auth($DOWNLOAD_CATS[$id_cat_for_download]['auth'], DOWNLOAD_READ_CAT_AUTH_BIT);
        }
        $id_cat_for_download = (int) $DOWNLOAD_CATS[$id_cat_for_download]['id_parent'];
    }
    if (!$auth_read) {
        $Errorh->handler('e_auth', E_USER_REDIRECT);
    }
    if (empty($info_file['url'])) {
        $Errorh->handler('e_unexist_file_download', E_USER_REDIRECT);
    }
    if ($info_file['force_download'] == DOWNLOAD_FORCE_DL && strpos($info_file['url'], '://') === false) {
        $info_file['url'] = second_parse_url($info_file['url']);
        $filesize = @filesize($info_file['url']);
        $filesize = $filesize !== false ? $filesize : (!empty($info_file) ? number_round($info_file['size'] * 1048576, 0) : false);
        if ($filesize !== false) {
            header('Content-Length: ' . $filesize);
        }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:count.php

示例12: elseif

    $type = 2;
    if (!empty($forum_info['url'])) {
        $type = 3;
    } elseif ($forum_info['level'] == 0) {
        $type = 1;
    }
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'ID' => $id, 'TYPE' => $type, 'CATEGORIES' => $forums, 'NAME' => $forum_info['name'], 'URL' => $forum_info['url'], 'DESC' => unparse($forum_info['subname']), 'CHECKED_APROB' => $forum_info['aprob'] == 1 ? 'checked="checked"' : '', 'UNCHECKED_APROB' => $forum_info['aprob'] == 0 ? 'checked="checked"' : '', 'CHECKED_STATUS' => $forum_info['status'] == 1 ? 'checked="checked"' : '', 'UNCHECKED_STATUS' => $forum_info['status'] == 0 ? 'checked="checked"' : '', 'AUTH_READ' => Authorizations::generate_select(READ_CAT_FORUM, $array_auth), 'AUTH_WRITE' => $is_root ? Authorizations::generate_select(WRITE_CAT_FORUM, $array_auth) : Authorizations::generate_select(WRITE_CAT_FORUM, $array_auth, array(), GROUP_DEFAULT_IDSELECT, GROUP_DISABLE_SELECT), 'AUTH_EDIT' => $is_root ? Authorizations::generate_select(EDIT_CAT_FORUM, $array_auth) : Authorizations::generate_select(EDIT_CAT_FORUM, $array_auth, array(), GROUP_DEFAULT_IDSELECT, GROUP_DISABLE_SELECT), 'DISABLED' => $is_root ? '0' : '1', 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_FORUM_MANAGEMENT' => $LANG['forum_management'], 'L_CAT_MANAGEMENT' => $LANG['cat_management'], 'L_ADD_CAT' => $LANG['cat_add'], 'L_FORUM_CONFIG' => $LANG['forum_config'], 'L_FORUM_GROUPS' => $LANG['forum_groups_config'], 'L_EDIT_CAT' => $LANG['cat_edit'], 'L_REQUIRE' => $LANG['require'], 'L_APROB' => $LANG['visible'], 'L_STATUS' => $LANG['status'], 'L_RANK' => $LANG['rank'], 'L_DELETE' => $LANG['delete'], 'L_PARENT_CATEGORY' => $LANG['parent_category'], 'L_NAME' => $LANG['name'], 'L_URL' => $LANG['url'], 'L_URL_EXPLAIN' => $LANG['url_explain'], 'L_DESC' => $LANG['description'], 'L_RESET' => $LANG['reset'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_LOCK' => $LANG['lock'], 'L_UNLOCK' => $LANG['unlock'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_UPDATE' => $LANG['update'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_AUTH_WRITE' => $LANG['auth_write'], 'L_AUTH_EDIT' => $LANG['auth_edit']));
    $Template->pparse('admin_forum_cat_edit');
} else {
    $Template->set_filenames(array('admin_forum_cat' => 'forum/admin_forum_cat.tpl'));
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'L_CONFIRM_DEL' => $LANG['del_entry'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_FORUM_MANAGEMENT' => $LANG['forum_management'], 'L_CAT_MANAGEMENT' => $LANG['cat_management'], 'L_ADD_CAT' => $LANG['cat_add'], 'L_FORUM_CONFIG' => $LANG['forum_config'], 'L_FORUM_GROUPS' => $LANG['forum_groups_config'], 'L_DELETE' => $LANG['delete'], 'L_NAME' => $LANG['name'], 'L_DESC' => $LANG['description'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_LOCK' => $LANG['lock'], 'L_UNLOCK' => $LANG['unlock'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_ADD' => $LANG['add'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_AUTH_WRITE' => $LANG['auth_write'], 'L_AUTH_EDIT' => $LANG['auth_edit'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none']));
    $max_cat = $Sql->query("SELECT MAX(id_left) FROM " . PREFIX . "forum_cats", __LINE__, __FILE__);
    $list_cats_js = '';
    $array_js = '';
    $i = 0;
    $result = $Sql->query_while("SELECT id, id_left, id_right, level, name, subname, url, status\n\tFROM " . PREFIX . "forum_cats\n\tORDER BY id_left", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $Template->assign_block_vars('list', array('I' => $i, 'ID' => $row['id'], 'NAME' => strlen($row['name']) > 60 ? substr($row['name'], 0, 60) . '...' : $row['name'], 'INDENT' => $row['level'] * 75, 'LOCK' => $row['status'] == 0 ? '<img class="valign_middle" src="../templates/' . get_utheme() . '/images/readonly.png" alt="" title="' . $LANG['lock'] . '" />' : '', 'URL' => !empty($row['url']) ? '<a href="' . $row['url'] . '"><img src="./forum_mini.png" alt="" class="valign_middle" /></a> ' : '', 'U_FORUM_VARS' => !empty($row['url']) ? $row['url'] : ($row['level'] > 0 ? 'forum' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php') : url('index.php?id=' . $row['id'], 'cat-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php'))));
        $list_cats_js .= $row['id'] . ', ';
        $array_js .= 'array_cats[' . $row['id'] . '] = new Array();' . "\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id\'] = ' . $row['id'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_left\'] = ' . $row['id_left'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_right\'] = ' . $row['id_right'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'i\'] = ' . $i . ";\n";
        $i++;
    }
    $Sql->query_close($result);
    $Template->assign_vars(array('LIST_CATS' => trim($list_cats_js, ', '), 'ARRAY_JS' => $array_js, 'ID_END' => $i - 1));
    $Template->pparse('admin_forum_cat');
}
require_once '../admin/admin_footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_forum.php

示例13: isset

    }
    $array_auth = isset($CONFIG_ARTICLES['auth_root']) ? $CONFIG_ARTICLES['auth_root'] : array();
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('articles'), 'AUTH_READ' => Authorizations::generate_select(READ_CAT_ARTICLES, $array_auth), 'L_ROOT' => $LANG['root'], 'L_ARTICLES_MANAGEMENT' => $LANG['articles_management'], 'L_ARTICLES_ADD' => $LANG['articles_add'], 'L_ARTICLES_CAT' => $LANG['cat_management'], 'L_ARTICLES_CONFIG' => $LANG['articles_config'], 'L_ARTICLES_CAT_ADD' => $LANG['articles_cats_add'], 'L_EDIT_CAT' => $LANG['cat_edit'], 'L_REQUIRE' => $LANG['require'], 'L_RESET' => $LANG['reset'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_UPDATE' => $LANG['update'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none']));
    $Template->pparse('admin_articles_cat_edit2');
} else {
    $Template->set_filenames(array('admin_articles_cat' => 'articles/admin_articles_cat.tpl'));
    $get_error = retrieve(GET, 'error', '');
    if ($get_error == 'unexist_cat') {
        $Errorh->handler($LANG['e_unexist_cat'], E_USER_NOTICE);
    }
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('articles'), 'L_CONFIRM_DEL' => $LANG['del_entry'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_ARTICLES_MANAGEMENT' => $LANG['articles_management'], 'L_ARTICLES_ADD' => $LANG['articles_add'], 'L_ARTICLES_CAT' => $LANG['cat_management'], 'L_ARTICLES_CONFIG' => $LANG['articles_config'], 'L_ARTICLES_CAT_ADD' => $LANG['articles_cats_add'], 'L_DELETE' => $LANG['delete'], 'L_ROOT' => $LANG['root'], 'L_NAME' => $LANG['name'], 'L_DESC' => $LANG['description'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_LOCK' => $LANG['lock'], 'L_UNLOCK' => $LANG['unlock'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_ADD' => $LANG['add'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_AUTH_WRITE' => $LANG['auth_write'], 'L_AUTH_EDIT' => $LANG['auth_edit'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none']));
    $max_cat = $Sql->query("SELECT MAX(id_left) FROM " . PREFIX . "articles_cats", __LINE__, __FILE__);
    $list_cats_js = '';
    $array_js = '';
    $i = 0;
    $result = $Sql->query_while("SELECT id, id_left, id_right, level, name, contents\n\tFROM " . PREFIX . "articles_cats\n\tORDER BY id_left", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $Template->assign_block_vars('list', array('I' => $i, 'ID' => $row['id'], 'NAME' => strlen($row['name']) > 60 ? substr($row['name'], 0, 60) . '...' : $row['name'], 'INDENT' => ($row['level'] + 1) * 75, 'U_ARTICLES_VARS' => url('.php?cat=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php')));
        $list_cats_js .= $row['id'] . ', ';
        $array_js .= 'array_cats[' . $row['id'] . '] = new Array();' . "\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id\'] = ' . $row['id'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_left\'] = ' . $row['id_left'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_right\'] = ' . $row['id_right'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'i\'] = ' . $i . ";\n";
        $i++;
    }
    $Sql->query_close($result);
    $Template->assign_vars(array('LIST_CATS' => trim($list_cats_js, ', '), 'ARRAY_JS' => $array_js, 'ID_END' => $i - 1));
    $Template->pparse('admin_articles_cat');
}
require_once '../admin/admin_footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_articles_cat.php

示例14: get_feed_data_struct

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     require_once PATH_TO_ROOT . '/download/download_auth.php';
     require_once PATH_TO_ROOT . '/download/download_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     global $Cache, $Sql, $LANG, $DOWNLOAD_LANG, $CONFIG, $CONFIG_DOWNLOAD, $DOWNLOAD_CATS;
     load_module_lang('download');
     $Cache->load('download');
     $data = new FeedData();
     $data->set_title($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=download&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(DOWNLOAD_READ_CAT_AUTH_BIT);
     $cats = new DownloadCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $req = "SELECT id, idcat, title, contents, timestamp, image\n        FROM " . PREFIX . "download\n        WHERE visible = 1 AND idcat IN (" . implode($children_cats, ',') . " )\n        ORDER BY timestamp DESC" . $Sql->limit(0, $CONFIG_DOWNLOAD['nbr_file_max']);
     $result = $Sql->query_while($req, __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/download/download' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $item->set_title($row['title']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($row['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], DOWNLOAD_READ_CAT_AUTH_BIT, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:38,代码来源:download_interface.class.php

示例15: array

    }
    $array_auth = !empty($CONFIG_GALLERY['auth_root']) ? $CONFIG_GALLERY['auth_root'] : array();
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('gallery'), 'AUTH_READ' => Authorizations::generate_select(READ_CAT_GALLERY, $array_auth), 'AUTH_WRITE' => Authorizations::generate_select(WRITE_CAT_GALLERY, $array_auth), 'AUTH_EDIT' => Authorizations::generate_select(EDIT_CAT_GALLERY, $array_auth), 'L_ROOT' => $LANG['root'], 'L_GALLERY_MANAGEMENT' => $LANG['gallery_management'], 'L_GALLERY_PICS_ADD' => $LANG['gallery_pics_add'], 'L_GALLERY_CAT_MANAGEMENT' => $LANG['gallery_cats_management'], 'L_GALLERY_CAT_ADD' => $LANG['gallery_cats_add'], 'L_GALLERY_CONFIG' => $LANG['gallery_config'], 'L_EDIT_CAT' => $LANG['cat_edit'], 'L_REQUIRE' => $LANG['require'], 'L_RESET' => $LANG['reset'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_UPDATE' => $LANG['update'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_AUTH_WRITE' => $LANG['auth_upload'], 'L_AUTH_EDIT' => $LANG['auth_edit'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none']));
    $Template->pparse('admin_gallery_cat_edit2');
} else {
    $Template->set_filenames(array('admin_gallery_cat' => 'gallery/admin_gallery_cat.tpl'));
    $get_error = !empty($_GET['error']) ? trim($_GET['error']) : '';
    if ($get_error == 'unexist_cat') {
        $Errorh->handler($LANG['e_unexist_cat'], E_USER_NOTICE);
    }
    $Template->assign_vars(array('THEME' => get_utheme(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('gallery'), 'L_CONFIRM_DEL' => $LANG['del_entry'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_GALLERY_MANAGEMENT' => $LANG['gallery_management'], 'L_GALLERY_PICS_ADD' => $LANG['gallery_pics_add'], 'L_GALLERY_CAT_MANAGEMENT' => $LANG['gallery_cats_management'], 'L_GALLERY_CAT_ADD' => $LANG['gallery_cats_add'], 'L_GALLERY_CONFIG' => $LANG['gallery_config'], 'L_DELETE' => $LANG['delete'], 'L_ROOT' => $LANG['root'], 'L_NAME' => $LANG['name'], 'L_DESC' => $LANG['description'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_LOCK' => $LANG['gallery_lock'], 'L_UNLOCK' => $LANG['gallery_unlock'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_ADD' => $LANG['add'], 'L_AUTH_READ' => $LANG['auth_read'], 'L_AUTH_WRITE' => $LANG['auth_write'], 'L_AUTH_EDIT' => $LANG['auth_edit'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none']));
    $max_cat = $Sql->query("SELECT MAX(id_left) FROM " . PREFIX . "gallery_cats", __LINE__, __FILE__);
    $list_cats_js = '';
    $array_js = '';
    $i = 0;
    $result = $Sql->query_while("SELECT id, id_left, id_right, level, name, contents, status\n\tFROM " . PREFIX . "gallery_cats \n\tORDER BY id_left", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $Template->assign_block_vars('list', array('I' => $i, 'ID' => $row['id'], 'NAME' => $row['name'], 'DESC' => $row['contents'], 'INDENT' => ($row['level'] + 1) * 75, 'LOCK' => $row['status'] == 0 ? '<img class="valign_middle" src="../templates/' . get_utheme() . '/images/readonly.png" alt="" title="' . $LANG['gallery_lock'] . '" />' : '', 'U_GALLERY_VARS' => url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php')));
        $list_cats_js .= $row['id'] . ', ';
        $array_js .= 'array_cats[' . $row['id'] . '] = new Array();' . "\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id\'] = ' . $row['id'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_left\'] = ' . $row['id_left'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'id_right\'] = ' . $row['id_right'] . ";\n";
        $array_js .= 'array_cats[' . $row['id'] . '][\'i\'] = ' . $i . ";\n";
        $i++;
    }
    $Sql->query_close($result);
    $Template->assign_vars(array('LIST_CATS' => trim($list_cats_js, ', '), 'ARRAY_JS' => $array_js, 'ID_END' => $i - 1));
    $Template->pparse('admin_gallery_cat');
}
require_once '../admin/admin_footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_gallery_cat.php


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