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


PHP load_module_lang函数代码示例

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


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

示例1: 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

示例2: get_feed_data_struct

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     global $Cache, $Sql, $LANG, $CONFIG, $CONFIG_NEWS;
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     load_module_lang('news');
     $data = new FeedData();
     $data->set_title($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=news&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']);
     $data->set_lang($LANG['xml_lang']);
     $Cache->load('news');
     $result = $Sql->query_while("SELECT id, title, contents, timestamp, img\n            FROM " . PREFIX . "news\n            WHERE visible = 1\n            ORDER BY timestamp DESC" . $Sql->limit(0, 2 * $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $item->set_title($row['title']);
         $link = new Url('/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $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['img']);
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:30,代码来源:news_interface.class.php

示例3: get_module_map

 private function get_module_map($auth_mode)
 {
     global $LANG;
     include PATH_TO_ROOT . '/pages/pages_defines.php';
     load_module_lang('pages');
     $pages_config = PagesConfig::load();
     $categories_cache = PagesCategoriesCache::load();
     $categories = $categories_cache->get_categories();
     //Configuration des authorisations
     $config_authorizations = $pages_config->get_authorizations();
     $pages_link = new SitemapLink($LANG['pages'], new Url('/pages/explorer.php'), Sitemap::FREQ_DEFAULT, Sitemap::PRIORITY_MAX);
     $module_map = new ModuleMap($pages_link, 'pages');
     $id_cat = 0;
     $keys = array_keys($categories);
     $num_cats = $categories_cache->get_number_categories();
     $properties = array();
     for ($j = 0; $j < $num_cats; $j++) {
         $id = $keys[$j];
         $properties = $categories[$id];
         if ($auth_mode == Sitemap::AUTH_PUBLIC) {
             $this_auth = is_array($properties['auth']) ? Authorizations::check_auth(RANK_TYPE, User::VISITOR_LEVEL, $properties['auth'], READ_PAGE) : Authorizations::check_auth(RANK_TYPE, User::VISITOR_LEVEL, $config_authorizations, READ_PAGE);
         } elseif ($auth_mode == Sitemap::AUTH_USER) {
             if (AppContext::get_current_user()->get_level() == User::ADMIN_LEVEL) {
                 $this_auth = true;
             } else {
                 $this_auth = is_array($properties['auth']) ? Authorizations::check_auth(RANK_TYPE, AppContext::get_current_user()->get_level(), $properties['auth'], READ_PAGE) : Authorizations::check_auth(RANK_TYPE, AppContext::get_current_user()->get_level(), $config_authorizations, READ_PAGE);
             }
         }
         if ($this_auth && $id != 0 && $properties['id_parent'] == $id_cat) {
             $module_map->add($this->create_module_map_sections($id, $auth_mode));
         }
     }
     return $module_map;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:34,代码来源:PagesSitemapExtensionPoint.class.php

示例4: guestbook_mini

function guestbook_mini($position, $block)
{
    global $LANG, $Cache, $_guestbook_rand_msg;
    if (strpos(SCRIPT, '/guestbook/guestbook.php') === false) {
        load_module_lang('guestbook');
        $Cache->load('guestbook');
        ###########################Affichage##############################
        $tpl = new Template('guestbook/guestbook_mini.tpl');
        import('core/menu_service');
        MenuService::assign_positions_conditions($tpl, $block);
        $rand = array_rand($_guestbook_rand_msg);
        $guestbook_rand = isset($_guestbook_rand_msg[$rand]) ? $_guestbook_rand_msg[$rand] : array();
        if ($guestbook_rand === array()) {
            $tpl->assign_vars(array('C_ANY_MESSAGE_GESTBOOK' => false, 'L_RANDOM_GESTBOOK' => $LANG['title_guestbook'], 'L_NO_MESSAGE_GESTBOOK' => $LANG['no_message_guestbook']));
        } else {
            if ($guestbook_rand['user_id'] != -1) {
                $guestbook_login = '<a class="small_link" href="' . TPL_PATH_TO_ROOT . '/member/member' . url('.php?id=' . $guestbook_rand['user_id'], '-' . $guestbook_rand['user_id'] . '.php') . '" title="' . $guestbook_rand['login'] . '"><span style="font-weight:bold;">' . wordwrap_html($guestbook_rand['login'], 13) . '</span></a>';
            } else {
                $guestbook_login = '<span style="font-style:italic;">' . (!empty($guestbook_rand['login']) ? wordwrap_html($guestbook_rand['login'], 13) : $LANG['guest']) . '</span>';
            }
            $tpl->assign_vars(array('C_ANY_MESSAGE_GESTBOOK' => true, 'L_RANDOM_GESTBOOK' => $LANG['title_guestbook'], 'RAND_MSG_ID' => $guestbook_rand['id'], 'RAND_MSG_CONTENTS' => strlen($guestbook_rand['contents']) > 149 ? ucfirst($guestbook_rand['contents']) . ' <a href="' . TPL_PATH_TO_ROOT . '/guestbook/guestbook.php" class="small_link">' . $LANG['guestbook_more_contents'] . '</a>' : ucfirst($guestbook_rand['contents']), 'RAND_MSG_LOGIN' => $guestbook_login, 'L_BY' => $LANG['by']));
        }
        return $tpl->parse(TEMPLATE_STRING_MODE);
    }
    return '';
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:26,代码来源:guestbook_mini.php

示例5: get_content

 public function get_content()
 {
     global $LANG;
     load_module_lang('search');
     $search = retrieve(REQUEST, 'q', '');
     $tpl = new FileTemplate('search/search_mini.tpl');
     $tpl->put_all(array('TEXT_SEARCHED' => !empty($search) ? stripslashes(retrieve(REQUEST, 'q', '')) : '', 'WARNING_LENGTH_STRING_SEARCH' => addslashes($LANG['warning_length_string_searched']), 'L_SEARCH' => $LANG['search'], 'U_FORM_VALID' => url(TPL_PATH_TO_ROOT . '/search/search.php#results'), 'L_ADVANCED_SEARCH' => $LANG['advanced_search'], 'U_ADVANCED_SEARCH' => url(TPL_PATH_TO_ROOT . '/search/search.php')));
     return $tpl;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:9,代码来源:SearchModuleMiniMenu.class.php

示例6: newsletter_mini

function newsletter_mini($position, $block)
{
    global $LANG, $User;
    load_module_lang('newsletter');
    $tpl = new Template('newsletter/newsletter_mini.tpl');
    import('core/menu_service');
    MenuService::assign_positions_conditions($tpl, $block);
    $tpl->assign_vars(array('SUBSCRIBE' => $LANG['subscribe'], 'UNSUBSCRIBE' => $LANG['unsubscribe'], 'USER_MAIL' => $User->get_attribute('user_mail') != '' ? $User->get_attribute('user_mail') : '', 'L_NEWSLETTER' => $LANG['newsletter'], 'L_SUBMIT' => $LANG['submit'], 'L_ARCHIVES' => $LANG['archives']));
    return $tpl->parse(TEMPLATE_STRING_MODE);
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:10,代码来源:newsletter_mini.php

示例7: get_actions_tree_links

 public function get_actions_tree_links()
 {
     global $LANG;
     load_module_lang('search');
     //Chargement de la langue du module.
     $tree = new ModuleTreeLinks();
     $tree->add_link(new AdminModuleLink($LANG['search_config'], new Url('/search/admin_search.php')));
     $tree->add_link(new AdminModuleLink($LANG['weights.manage'], new Url('/search/admin_search.php?weighting=true')));
     return $tree;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:SearchTreeLinks.class.php

示例8: search_mini

function search_mini($position, $block)
{
    global $LANG;
    load_module_lang('search');
    $search = retrieve(REQUEST, 'q', '');
    $tpl = new Template('search/search_mini.tpl');
    import('core/menu_service');
    MenuService::assign_positions_conditions($tpl, $block);
    $tpl->assign_vars(array('TITLE_SEARCH' => TITLE, 'SEARCH' => $LANG['title_search'], 'TEXT_SEARCHED' => !empty($search) ? stripslashes(retrieve(REQUEST, 'q', '')) : $LANG['search'] . '...', 'WARNING_LENGTH_STRING_SEARCH' => addslashes($LANG['warning_length_string_searched']), 'L_SEARCH' => $LANG['search'], 'U_FORM_VALID' => url(TPL_PATH_TO_ROOT . '/search/search.php#results'), 'L_ADVANCED_SEARCH' => $LANG['advanced_search'], 'U_ADVANCED_SEARCH' => url(TPL_PATH_TO_ROOT . '/search/search.php')));
    return $tpl->parse(TEMPLATE_STRING_MODE);
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:11,代码来源:search_mini.php

示例9: get_search_form

 public function get_search_form($args = null)
 {
     require_once PATH_TO_ROOT . '/kernel/begin.php';
     load_module_lang('wiki');
     global $LANG;
     $tpl = new FileTemplate('wiki/wiki_search_form.tpl');
     if (!isset($args['WikiWhere']) || !in_array($args['WikiWhere'], explode(',', 'title,contents,all'))) {
         $args['WikiWhere'] = 'title';
     }
     $tpl->put_all(array('L_WHERE' => $LANG['wiki_search_where'], 'IS_TITLE_SELECTED' => $args['WikiWhere'] == 'title' ? ' selected="selected"' : '', 'IS_CONTENTS_SELECTED' => $args['WikiWhere'] == 'contents' ? ' selected="selected"' : '', 'IS_ALL_SELECTED' => $args['WikiWhere'] == 'all' ? ' selected="selected"' : '', 'L_TITLE' => $LANG['wiki_search_where_title'], 'L_CONTENTS' => $LANG['wiki_search_where_contents']));
     return $tpl->render();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:WikiSearchable.class.php

示例10: get_menu_content

 public function get_menu_content()
 {
     global $LANG;
     //Chargement de la langue du module.
     load_module_lang('stats');
     $tpl = new FileTemplate('stats/stats_mini.tpl');
     $stats_cache = StatsCache::load();
     $l_member_registered = $stats_cache->get_stats_properties('nbr_members') > 1 ? $LANG['member_registered_s'] : $LANG['member_registered'];
     $group_color = User::get_group_color($stats_cache->get_stats_properties('last_member_groups'), $stats_cache->get_stats_properties('last_member_level'));
     $tpl->put_all(array('L_MORE_STAT' => $LANG['more_stats'], 'L_USER_REGISTERED' => sprintf($l_member_registered, $stats_cache->get_stats_properties('nbr_members')), 'L_LAST_REGISTERED_USER' => $LANG['last_member'], 'U_LINK_LAST_USER' => '<a href="' . UserUrlBuilder::profile($stats_cache->get_stats_properties('last_member_id'))->rel() . '" class="' . UserService::get_level_class($stats_cache->get_stats_properties('last_member_level')) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . '>' . $stats_cache->get_stats_properties('last_member_login') . '</a>'));
     return $tpl->render();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:StatsModuleMiniMenu.class.php

示例11: online_mini

function online_mini($position, $block)
{
    if (strpos(SCRIPT, '/online/online.php') === false) {
        global $LANG, $Cache, $Sql, $CONFIG, $CONFIG_ONLINE;
        load_module_lang('online');
        $Cache->load('online');
        $tpl = new Template('online/online_mini.tpl');
        import('core/menu_service');
        MenuService::assign_positions_conditions($tpl, $block);
        list($count_visit, $count_member, $count_modo, $count_admin) = array(0, 0, 0, 0);
        $i = 0;
        $array_class = array('member', 'modo', 'admin');
        $result = $Sql->query_while("SELECT s.user_id, s.level, s.session_time, m.user_groups, m.login\n    \tFROM " . DB_TABLE_SESSIONS . " s\n    \tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = s.user_id\n    \tWHERE s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n    \tORDER BY " . $CONFIG_ONLINE['display_order_online'], __LINE__, __FILE__);
        while ($row = $Sql->fetch_assoc($result)) {
            if ($i < $CONFIG_ONLINE['online_displayed']) {
                if ($row['level'] !== '-1') {
                    $group_color = User::get_group_color($row['user_groups'], $row['level']);
                    $tpl->assign_block_vars('online', array('USER' => '<a href="' . TPL_PATH_TO_ROOT . '/member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '" class="' . $array_class[$row['level']] . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . '>' . wordwrap_html($row['login'], 19) . '</a><br />'));
                    $i++;
                }
            }
            switch ($row['level']) {
                case '-1':
                    $count_visit++;
                    break;
                case '0':
                    $count_member++;
                    break;
                case '1':
                    $count_modo++;
                    break;
                case '2':
                    $count_admin++;
                    break;
            }
        }
        $Sql->query_close($result);
        $count_visit = empty($count_visit) && empty($count_member) && empty($count_modo) && empty($count_admin) ? '1' : $count_visit;
        $total = $count_visit + $count_member + $count_modo + $count_admin;
        $total_member = $count_member + $count_modo + $count_admin;
        $member_online = $LANG['member_s'] . ' ' . strtolower($LANG['online']);
        $more = '<br /><a href="../online/online.php' . SID . '" title="' . $member_online . '">' . $member_online . '</a><br />';
        $more = $total_member > $CONFIG_ONLINE['online_displayed'] ? $more : '';
        $l_guest = $count_visit > 1 ? $LANG['guest_s'] : $LANG['guest'];
        $l_member = $count_member > 1 ? $LANG['member_s'] : $LANG['member'];
        $l_modo = $count_modo > 1 ? $LANG['modo_s'] : $LANG['modo'];
        $l_admin = $count_admin > 1 ? $LANG['admin_s'] : $LANG['admin'];
        $tpl->assign_vars(array('VISIT' => $count_visit, 'USER' => $count_member, 'MODO' => $count_modo, 'ADMIN' => $count_admin, 'MORE' => $more, 'TOTAL' => $total, 'L_VISITOR' => $l_guest, 'L_USER' => $l_member, 'L_MODO' => $l_modo, 'L_ADMIN' => $l_admin, 'L_ONLINE' => $LANG['online'], 'L_TOTAL' => $LANG['total']));
        return $tpl->parse(TEMPLATE_STRING_MODE);
    }
    return '';
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:52,代码来源:online_mini.php

示例12: get_actions_tree_links

 public function get_actions_tree_links()
 {
     global $LANG;
     load_module_lang('poll');
     //Chargement de la langue du module.
     $tree = new ModuleTreeLinks();
     $manage_poll_link = new AdminModuleLink($LANG['poll.manage'], new Url('/poll/admin_poll.php'));
     $manage_poll_link->add_sub_link(new AdminModuleLink($LANG['poll.manage'], new Url('/poll/admin_poll.php')));
     $manage_poll_link->add_sub_link(new AdminModuleLink($LANG['poll_add'], new Url('/poll/admin_poll_add.php')));
     $tree->add_link($manage_poll_link);
     $tree->add_link(new AdminModuleLink(LangLoader::get_message('configuration', 'admin'), new Url('/poll/admin_poll_config.php')));
     return $tree;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:13,代码来源:PollTreeLinks.class.php

示例13: stats_mini

function stats_mini($position, $block)
{
    global $LANG, $Cache, $nbr_members, $last_member_id, $last_member_login;
    load_module_lang('stats');
    #########################Stats.tpl###########################
    $tpl = new Template('stats/stats_mini.tpl');
    import('core/menu_service');
    MenuService::assign_positions_conditions($tpl, $block);
    $Cache->load('stats');
    $l_member_registered = $nbr_members > 1 ? $LANG['member_registered_s'] : $LANG['member_registered'];
    $tpl->assign_vars(array('SID' => SID, 'L_STATS' => $LANG['stats'], 'L_MORE_STAT' => $LANG['more_stats'], 'L_USER_REGISTERED' => sprintf($l_member_registered, $nbr_members), 'L_LAST_REGISTERED_USER' => $LANG['last_member'], 'U_LINK_LAST_USER' => '<a href="' . HOST . DIR . '/member/member' . url('.php?id=' . $last_member_id, '-' . $last_member_id . '.php') . '">' . $last_member_login . '</a>'));
    return $tpl->parse(TEMPLATE_STRING_MODE);
}
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:13,代码来源:stats_mini.php

示例14: get_menu_content

 public function get_menu_content()
 {
     global $LANG;
     $poll_config = PollConfig::load();
     $config_cookie_name = $poll_config->get_cookie_name();
     $polls = PollMiniMenuCache::load()->get_polls();
     //Chargement de la langue du module.
     load_module_lang('poll');
     $rand = array_rand($polls);
     $poll_mini = $polls[$rand];
     //Sondage aléatoire.
     $tpl = new FileTemplate('poll/poll_mini.tpl');
     #####################Résultats######################
     //Si le cookie existe, on redirige vers les resulats, sinon on prend en compte le vote (vérification par ip plus tard).
     $array_cookie = array();
     if (AppContext::get_request()->has_cookieparameter($config_cookie_name)) {
         $array_cookie = explode('/', AppContext::get_request()->get_cookie($config_cookie_name));
     }
     if (in_array($poll_mini['id'], $array_cookie)) {
         $tpl->put_all(array('L_VOTE' => $poll_mini['total'] > 1 ? $LANG['poll_vote_s'] : $LANG['poll_vote']));
         $tpl->assign_block_vars('result', array('QUESTION' => $poll_mini['question'], 'VOTES' => $poll_mini['total']));
         foreach ($poll_mini['votes'] as $answer => $width) {
             $tpl->assign_block_vars('result.answers', array('ANSWERS' => $answer, 'WIDTH' => NumberHelper::round($width, 0), 'PERCENT' => $width));
         }
     } else {
         #####################Questions######################
         $tpl->put_all(array('L_MINI_POLL' => $LANG['mini_poll'], 'L_VOTE' => $LANG['poll_vote'], 'L_POLL_RESULT' => $LANG['poll_result'], 'U_POLL_RESULT' => url('.php?id=' . $poll_mini['id'] . '&amp;r=1', '-' . $poll_mini['id'] . '-1.php')));
         $tpl->assign_block_vars('question', array('ID' => url('.php?id=' . $poll_mini['id'], '-' . $poll_mini['id'] . '.php'), 'QUESTION' => $poll_mini['question']));
         $z = 0;
         if ($poll_mini['type'] == '1') {
             if (is_array($poll_mini['votes'])) {
                 // FIXME should always be an array, needs to patch cache generation
                 foreach ($poll_mini['votes'] as $answer => $width) {
                     $tpl->assign_block_vars('question.radio', array('NAME' => $z, 'ANSWERS' => $answer));
                     $z++;
                 }
             }
         } elseif ($poll_mini['type'] == '0') {
             foreach ($poll_mini['votes'] as $answer => $width) {
                 $tpl->assign_block_vars('question.checkbox', array('NAME' => $z, 'ANSWERS' => $answer));
                 $z++;
             }
         }
     }
     return $tpl->render();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:46,代码来源:PollModuleMiniMenu.class.php

示例15: get_view

 private function get_view()
 {
     global $Bread_crumb, $LANG, $encoded_title, $id_article, $article_infos, $id_cat;
     load_module_lang('wiki');
     include_once PATH_TO_ROOT . '/wiki/wiki_functions.php';
     $bread_crumb_key = 'wiki';
     require_once PATH_TO_ROOT . '/wiki/wiki_bread_crumb.php';
     $config = WikiConfig::load();
     $tpl = new FileTemplate('wiki/index.tpl');
     if ($config->get_number_articles_on_index() > 1) {
         $result = PersistenceContext::get_querier()->select("SELECT a.title, a.encoded_title, a.id\r\n\t\t\tFROM " . PREFIX . "wiki_articles a\r\n\t\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\r\n\t\t\tWHERE a.redirect = 0\r\n\t\t\tORDER BY c.timestamp DESC\r\n\t\t\tLIMIT :number_articles_on_index OFFSET 0", array('number_articles_on_index' => $config->get_number_articles_on_index()));
         $tpl->assign_block_vars('last_articles', array('C_ARTICLES' => $result->get_rows_count(), 'L_ARTICLES' => $LANG['wiki_last_articles_list']));
         $i = 0;
         while ($row = $result->fetch()) {
             $tpl->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++;
         }
         $result->dispose();
         if ($i == 0) {
             $tpl->put_all(array('L_NO_ARTICLE' => '<td class="center" colspan="2">' . $LANG['wiki_no_article'] . '</td>'));
         }
     }
     //Affichage de toutes les catégories si c'est activé
     if ($config->are_categories_displayed_on_index()) {
         $tpl->assign_block_vars('cat_list', array('L_CATS' => $LANG['wiki_cats_list']));
         $i = 0;
         foreach (WikiCategoriesCache::load()->get_categories() as $id => $cat) {
             //Si c'est une catégorie mère
             if ($cat['id_parent'] == 0) {
                 $tpl->assign_block_vars('cat_list.list', array('CAT' => stripslashes($cat['title']), 'U_CAT' => url('wiki.php?title=' . $cat['encoded_title'], $cat['encoded_title'])));
                 $i++;
             }
         }
         if ($i == 0) {
             $tpl->put_all(array('L_NO_CAT' => $LANG['wiki_no_cat']));
         }
     }
     $tpl->put_all(array('TITLE' => $config->get_wiki_name() ? $config->get_wiki_name() : $LANG['wiki'], 'INDEX_TEXT' => $config->get_index_text() ? FormatingHelper::second_parse(wiki_no_rewrite($config->get_index_text())) : $LANG['wiki_empty_index'], 'L_EXPLORER' => $LANG['wiki_explorer'], 'U_EXPLORER' => url('explorer.php')));
     $page_type = 'index';
     include PATH_TO_ROOT . '/wiki/wiki_tools.php';
     $tpl->put('wiki_tools', $tools_tpl);
     return new StringTemplate($tpl->render());
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:43,代码来源:WikiHomePageExtensionPoint.class.php


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