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


PHP XTemplate::assign方法代码示例

本文整理汇总了PHP中XTemplate::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP XTemplate::assign方法的具体用法?PHP XTemplate::assign怎么用?PHP XTemplate::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XTemplate的用法示例。


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

示例1: result_theme

/**
 * result_theme()
 * 
 * @param mixed $result_array
 * @param mixed $mod
 * @param mixed $mod_custom_title
 * @param mixed $key
 * @param mixed $ss
 * @param mixed $is_generate_page
 * @param mixed $pages
 * @param mixed $limit
 * @param mixed $all_page
 * @return
 */
function result_theme($result_array, $mod, $mod_custom_title, $key, $logic, $ss, $is_generate_page, $pages, $limit, $all_page)
{
    global $module_info, $module_file, $global_config, $lang_global, $lang_module, $db, $module_name;
    $xtpl = new XTemplate("result.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('HIDDEN_KEY', $key);
    $xtpl->assign('SEARCH_RESULT_NUM', $all_page);
    $xtpl->assign('MODULE_CUSTOM_TITLE', $mod_custom_title);
    foreach ($result_array as $result) {
        $xtpl->assign('RESULT', $result);
        $xtpl->parse('main.result');
    }
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=adv&search_query=" . rawurlencode($key) . "&search_mod=" . $mod . "&search_ss=" . $ss . "&logic=" . $logic;
    if ($is_generate_page) {
        $generate_page = nv_generate_page($base_url, $all_page, $limit, $pages, true, true, 'nv_urldecode_ajax', 'search_result');
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
    } else {
        if ($all_page > $limit) {
            $xtpl->assign('MORE', "nv_search_viewall('" . $mod . "', " . NV_MIN_SEARCH_LENGTH . ", " . NV_MAX_SEARCH_LENGTH . ")");
            $xtpl->parse('main.more');
        }
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:42,代码来源:theme.php

示例2: XTemplate

 function nv_news_category($block_config)
 {
     global $module_array_cat, $module_info, $lang_module;
     $xtpl = new XTemplate("block_category.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/news");
     if (!empty($module_array_cat)) {
         $title_length = $block_config['title_length'];
         $xtpl->assign('LANG', $lang_module);
         $xtpl->assign('BLOCK_ID', $block_config['bid']);
         $xtpl->assign('TEMPLATE', $module_info['template']);
         $html = "";
         foreach ($module_array_cat as $cat) {
             if ($cat['parentid'] == 0) {
                 $html .= "<li>\n";
                 $html .= "<a title=\"" . $cat['title'] . "\" href=\"" . $cat['link'] . "\">" . nv_clean60($cat['title'], $title_length) . "</a>\n";
                 if (!empty($cat['subcatid'])) {
                     $html .= nv_news_sub_category($cat['subcatid'], $title_length);
                 }
                 $html .= "</li>\n";
             }
         }
         $xtpl->assign('HTML_CONTENT', $html);
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:25,代码来源:global.block_category.php

示例3: array

 function nv_weather_blocks($block_config)
 {
     global $global_config, $site_mods, $db, $module_name;
     $module = $block_config['module'];
     $array_th = array();
     $sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_weather WHERE status = 1 ORDER BY weight ASC';
     $list = nv_db_cache($sql, '', $module);
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/weather/block.weather.tpl')) {
         $block_theme = $global_config['module_theme'];
     } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/weather/block.weather.tpl')) {
         $block_theme = $global_config['site_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block.weather.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/weather');
     $xtpl->assign('TEMPLATE', $block_theme);
     $xtpl->assign('CODE', $block_config['location']);
     $xtpl->assign('NUM_DAY', $block_config['numday']);
     foreach ($list as $row) {
         $block_config['location'] == $row['location_code'] ? $row['selected'] = ' selected="selected"' : ($row['selected'] = '');
         $xtpl->assign('ROW', $row);
         $xtpl->parse('main.loop');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:NukeVlad,项目名称:nukeviet-weather,代码行数:26,代码来源:global.weather.php

示例4: nv_theme_event_detail

/**
 * nv_theme_event_detail()
 *
 * @param mixed $array_data
 * @return
 */
function nv_theme_event_detail($array_data)
{
    global $global_config, $module_name, $module_file, $lang_module, $module_config, $module_info, $op, $global_array_event_cat;
    if (NV_CURRENTTIME >= $array_data['start_time'] and NV_CURRENTTIME <= $array_data['end_time']) {
        $array_data['status_str'] = $lang_module['status_2'];
    } elseif (NV_CURRENTTIME < $array_data['start_time']) {
        $array_data['status_str'] = $lang_module['status_1'];
    } else {
        $array_data['status_str'] = $lang_module['status_0'];
    }
    $array_data['start_date'] = nv_date('d/m/Y', $array_data['start_time']);
    $array_data['start_time'] = nv_date('H:i', $array_data['start_time']);
    $array_data['end_date'] = nv_date('d/m/Y', $array_data['end_time']);
    $array_data['end_time'] = nv_date('H:i', $array_data['end_time']);
    $array_data['title_cat'] = $global_array_event_cat[$array_data['catid']]['title'];
    $array_data['url_cat'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $global_array_event_cat[$array_data['catid']]['alias'];
    $xtpl = new XTemplate($op . '.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('DATA', $array_data);
    if ($array_data['start_date'] == $array_data['end_date']) {
        $xtpl->parse('main.day');
    } else {
        $xtpl->parse('main.longday');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:hoangvtien,项目名称:module-event,代码行数:33,代码来源:theme.php

示例5: viewdirtree

/**
 * viewdirtree()
 * 
 * @param mixed $dir
 * @param mixed $currentpath
 * @return
 */
function viewdirtree($dir, $currentpath)
{
    global $dirlist, $global_config, $module_file;
    $pattern = !empty($dir) ? "/^(" . nv_preg_quote($dir) . ")\\/([^\\/]+)\$/" : "/^([^\\/]+)\$/";
    $_dirlist = preg_grep($pattern, $dirlist);
    $content = "";
    foreach ($_dirlist as $_dir) {
        $check_allow_upload_dir = nv_check_allow_upload_dir($_dir);
        if (!empty($check_allow_upload_dir)) {
            $class_li = ($_dir == $currentpath or strpos($currentpath, $_dir . '/') !== false) ? "open collapsable" : "expandable";
            $style_color = $_dir == $currentpath ? ' style="color:red"' : '';
            $tree = array();
            $tree['class1'] = $class_li;
            $tree['class2'] = nv_set_dir_class($check_allow_upload_dir) . " pos" . nv_string_to_filename($dir);
            $tree['style'] = $style_color;
            $tree['title'] = $_dir;
            $tree['titlepath'] = basename($_dir);
            $content2 = viewdirtree($_dir, $currentpath);
            $xtpl = new XTemplate("foldlist.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
            $xtpl->assign("DIRTREE", $tree);
            if (!empty($content2)) {
                $xtpl->assign("TREE_CONTENT", $content2);
                $xtpl->parse('tree.tree_content');
            }
            $xtpl->parse('tree');
            $content .= $xtpl->text('tree');
        }
    }
    return $content;
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:37,代码来源:folderlist.php

示例6: elseif

 /**
  * nv_menu_theme_default_footer()
  *
  * @param mixed $block_config
  * @return
  */
 function nv_copyright_info($block_config)
 {
     global $global_config, $lang_global;
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/blocks/global.copyright.tpl')) {
         $block_theme = $global_config['module_theme'];
     } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/blocks/global.copyright.tpl')) {
         $block_theme = $global_config['site_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('global.copyright.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/blocks');
     $xtpl->assign('LANG', $lang_global);
     if (empty($block_config['copyright_by'])) {
         $block_config['copyright_by'] = $global_config['site_name'];
     }
     if (empty($block_config['copyright_url'])) {
         $block_config['copyright_url'] = "http://" . $global_config['my_domains'][0];
     }
     $xtpl->assign('DATA', $block_config);
     $xtpl->parse('main.copyright_by.copyright_url');
     $xtpl->parse('main.copyright_by.copyright_url2');
     $xtpl->parse('main.copyright_by');
     if (!empty($block_config['design_by'])) {
         if (!empty($block_config['design_url'])) {
             $xtpl->parse('main.design_by.design_url');
             $xtpl->parse('main.design_by.design_url2');
         }
         $xtpl->parse('main.design_by');
     }
     if (!empty($block_config['siteterms_url'])) {
         $xtpl->parse('main.siteterms_url');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:41,代码来源:global.copyright.php

示例7: search_result_theme

/**
 * result_theme()
 *
 * @param mixed $result_array
 * @param mixed $mod
 * @param mixed $mod_custom_title
 * @param mixed $search
 * @param mixed $is_generate_page
 * @param mixed $limit
 * @param mixed $num_items
 * @return
 */
function search_result_theme($result_array, $mod, $mod_custom_title, $search, $is_generate_page, $limit, $num_items)
{
    global $module_info, $module_file, $global_config, $lang_global, $lang_module, $db, $module_name;
    $xtpl = new XTemplate('result.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('SEARCH_RESULT_NUM', $num_items);
    $xtpl->assign('MODULE_CUSTOM_TITLE', $mod_custom_title);
    $xtpl->assign('HIDDEN_KEY', $search['key']);
    foreach ($result_array as $result) {
        $xtpl->assign('RESULT', $result);
        $xtpl->parse('main.result');
    }
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&q=" . urlencode($search['key']);
    if ($mod != "all") {
        $base_url .= "&m=" . $mod;
    }
    $base_url .= "&l=" . $search['logic'];
    if ($is_generate_page) {
        $generate_page = nv_generate_page($base_url, $num_items, $limit, $search['page']);
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
    } else {
        if ($num_items > $limit) {
            $xtpl->assign('MORE', $base_url);
            $xtpl->parse('main.more');
        }
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:44,代码来源:theme.php

示例8: XTemplate

 function nv_blog_news_tags($block_config)
 {
     global $site_mods, $module_array_cat, $global_config, $lang_module, $db, $module_config, $module_info;
     $module = $block_config['module'];
     $mod_data = $site_mods[$module]['module_data'];
     $mod_file = $site_mods[$module]['module_file'];
     $block_theme = nv_check_theme($mod_file);
     $xtpl = new XTemplate('block.news_tags.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $mod_file);
     $xtpl->assign('LANG', $lang_module);
     $xtpl->assign('TEMPLATE', $block_theme);
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $excluded = $block_config['excluded'];
     if (!empty($excluded)) {
         $sql = 'SELECT tid, numnews, alias, keywords FROM ' . NV_PREFIXLANG . '_' . $mod_data . '_tags WHERE tid NOT IN (' . $excluded . ') ORDER BY ' . $block_config['tagsort'] . ' ' . $block_config['tagsort_type'] . ' LIMIT 0, ' . $block_config['numrow'];
     } else {
         $sql = 'SELECT tid, numnews, alias, keywords FROM ' . NV_PREFIXLANG . '_' . $mod_data . '_tags ORDER BY ' . $block_config['tagsort'] . ' ' . $block_config['tagsort_type'] . ' LIMIT 0, ' . $block_config['numrow'];
     }
     $list = $nv_Cache->db($sql, 'id', $module);
     if (!empty($list)) {
         foreach ($list as $l) {
             $l['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=tag/' . $l['alias'];
             if (!empty($block_config['newslinks'])) {
                 $xtpl->assign('COUNT', $l['numnews']);
                 $xtpl->parse('main.loop.count_tags');
             }
             $xtpl->assign('LOOP', $l);
             $xtpl->parse('main.loop');
         }
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:nukeplus,项目名称:videos,代码行数:32,代码来源:global.news_tags.php

示例9: gui_loi_cam_on_da_dang_ky

function gui_loi_cam_on_da_dang_ky($ten, $dienthoai, $email, $cty, $diachi, $tp)
{
    include_once 'xtemplate.class.php';
    $header = 'Content-type: text/html; charset=utf-8\\r\\n';
    $title = get_bloginfo('name');
    $contact_email = get_option('contact_email');
    $contact_name = get_bloginfo('name');
    $parseTemplate = new XTemplate('xtemplate.cam-on-da-dang-ky.html');
    $parseTemplate->assign('website', get_bloginfo('name'));
    $parseTemplate->assign('link', get_bloginfo('home'));
    $parseTemplate->assign('fullname', $ten);
    $parseTemplate->assign('phone', $dienthoai);
    $parseTemplate->assign('email', $email);
    $parseTemplate->assign('cty', $cty);
    $parseTemplate->assign('diachi', $diachi);
    $parseTemplate->assign('tp', $tp);
    $parseTemplate->assign('contact_email', $contact_email);
    $parseTemplate->assign('contact_name', $contact_name);
    $parseTemplate->parse('main');
    $mail = wp_mail($email, $title, $parseTemplate->text('main'), $title);
    if ($mail) {
        ?>
                <script>
                alert ('Gửi mail thành công');
                </script>
                <?php 
    } else {
        ?>
                <script>
                alert ('Vui lòng thử lại');
                </script>
                <?php 
    }
}
开发者ID:binhdarkcu,项目名称:shoping_quan,代码行数:34,代码来源:xtemplate.cam-on-da-dang-ky.php

示例10: elseif

 function nv_menu_theme_social($block_config)
 {
     global $global_config, $site_mods;
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/blocks/global.social.tpl')) {
         $block_theme = $global_config['module_theme'];
     } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/blocks/global.social.tpl')) {
         $block_theme = $global_config['site_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('global.social.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/blocks');
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $xtpl->assign('BLOCK_THEME', $block_theme);
     $xtpl->assign('DATA', $block_config);
     if (!empty($block_config['facebook'])) {
         $xtpl->parse('main.facebook');
     }
     if (!empty($block_config['google_plus'])) {
         $xtpl->parse('main.google_plus');
     }
     if (!empty($block_config['youtube'])) {
         $xtpl->parse('main.youtube');
     }
     if (!empty($block_config['twitter'])) {
         $xtpl->parse('main.twitter');
     }
     if (isset($site_mods['feeds'])) {
         $xtpl->assign('FEEDS_HREF', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=feeds');
         $xtpl->parse('main.feeds');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:33,代码来源:global.social.php

示例11: XTemplate

 function nv_archives_category($block_config)
 {
     global $module_archives_cat, $module_info, $lang_module, $global_config, $site_mods;
     $module = $block_config['module'];
     $mod_data = $site_mods[$module]['module_data'];
     $mod_file = $site_mods[$module]['module_file'];
     if (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/modules/" . $mod_file . "/block_category.tpl")) {
         $block_theme = $global_config['site_theme'];
     } else {
         $block_theme = "default";
     }
     $xtpl = new XTemplate("block_category.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/modules/laws");
     $xtpl->assign('LANG', $lang_module);
     if (!empty($module_archives_cat)) {
         $title_length = $block_config['title_length'];
         $xtpl->assign('LANG', $lang_module);
         $xtpl->assign('BLOCK_ID', $block_config['bid']);
         $xtpl->assign('TEMPLATE', $block_theme);
         $html = "";
         foreach ($module_archives_cat as $cat) {
             if ($cat['parentid'] == 0) {
                 $html .= "<li>\n";
                 $html .= "<a title=\"" . $cat['title'] . "\" href=\"" . $cat['link'] . "\">" . nv_clean60($cat['title'], $title_length) . "</a>\n";
                 if (!empty($cat['subcatid'])) {
                     $html .= nv_archives_sub_category($cat['subcatid'], $title_length);
                 }
                 $html .= "</li>\n";
             }
         }
         $xtpl->assign('HTML_CONTENT', $html);
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:34,代码来源:global.block_category.php

示例12: nv_page_main_list

/**
 * nv_page_main_list()
 *
 * @param mixed $array_data
 * @return
 */
function nv_page_main_list($array_data, $generate_page)
{
    global $global_config, $module_file, $lang_global, $module_upload, $module_info, $module_name;
    $template = file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file . '/main_list.tpl') ? $module_info['template'] : 'default';
    $xtpl = new XTemplate('main_list.tpl', NV_ROOTDIR . '/themes/' . $template . '/modules/' . $module_file);
    $xtpl->assign('GLANG', $lang_global);
    if (!empty($array_data)) {
        foreach ($array_data as $row) {
            if (!empty($row['image'])) {
                $row['image'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['image'];
                $row['imagealt'] = !empty($row['imagealt']) ? $row['imagealt'] : $row['title'];
            }
            $xtpl->assign('DATA', $row);
            if (!empty($row['image'])) {
                $xtpl->parse('main.loop.image');
            }
            if (defined('NV_IS_MODADMIN')) {
                $xtpl->assign('ADMIN_CHECKSS', md5($row['id'] . $global_config['sitekey'] . session_id()));
                $xtpl->assign('ADMIN_EDIT', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=content&amp;id=' . $row['id']);
                $xtpl->parse('main.loop.adminlink');
            }
            $xtpl->parse('main.loop');
        }
        if ($generate_page != '') {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
        }
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:nukeplus,项目名称:support,代码行数:36,代码来源:theme.php

示例13: elseif

 function nv_block_language($block_config)
 {
     global $global_config, $site_mods, $lang_global, $language_array;
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/blocks/global.block_language.tpl')) {
         $block_theme = $global_config['module_theme'];
     } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/blocks/global.block_language.tpl')) {
         $block_theme = $global_config['site_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('global.block_language.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/blocks');
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $xtpl->assign('BLOCK_THEME', $block_theme);
     $xtpl->assign('SELECT_LANGUAGE', $lang_global['langsite']);
     // Multiple languages
     if ($global_config['lang_multi'] and sizeof($global_config['allow_sitelangs']) > 1) {
         foreach ($global_config['allow_sitelangs'] as $lang_i) {
             $xtpl->assign('LANGSITENAME', $language_array[$lang_i]['name']);
             $xtpl->assign('LANGSITEURL', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . $lang_i);
             if (NV_LANG_DATA != $lang_i) {
                 $xtpl->parse('main.language.langitem');
             } else {
                 $xtpl->parse('main.language.langcuritem');
             }
         }
         $xtpl->parse('main.language');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:30,代码来源:global.block_language.php

示例14: displayNewsFeed

function displayNewsFeed($template_file, $level = "")
{
    $tpl = new XTemplate($template_file);
    $rss = getNewsFeed();
    if (!$rss) {
        return 'There are no articles in this news feed';
    }
    // end if
    $limit = 2;
    $count = 0;
    foreach ($rss as $item) {
        if ($count > $limit - 1) {
            break;
        }
        $count++;
        $tpl->assign('BlogNewsLink', $item['link']);
        $tpl->assign('BlogNewsTitle', $item['title']);
        $tpl->assign('BlogNewsPubDate', $item['date']);
        $tpl->assign('BlogNewsCreator', $item['creator']);
        $tpl->assign('BlogNewsCategory', $item['category']);
        $tpl->parse('main' . $level . '.BlogNews');
    }
    // end foreach
    return $tpl->text('main' . $level . '.BlogNews');
}
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:25,代码来源:news_functions.php

示例15: XTemplate

 function display_page($p)
 {
     $page = $this->db->quick_query('SELECT * FROM %ppages WHERE page_id=%d', $p);
     if (!$page) {
         return $this->error('The page you are looking for does not exist. It may have been deleted or the URL is incorrect.', 404);
     }
     $xtpl = new XTemplate('./skins/' . $this->skin . '/page.xtpl');
     $this->title($page['page_title']);
     $this->meta_description($page['page_meta']);
     $sidebar = null;
     $content = $this->format($page['page_content'], $page['page_flags']);
     if ($page['page_flags'] & POST_HTML && $page['page_flags'] & POST_BBCODE) {
         $content = html_entity_decode($content, ENT_COMPAT, 'UTF-8');
     }
     $xtpl->assign('content', $content);
     if ($page['page_flags'] & POST_SIDEBAR) {
         $SideBar = new sidebar($this);
         $sidebar = $SideBar->build_sidebar();
         $xtpl->parse('Page.HasSidebar');
     } else {
         $xtpl->parse('Page.NoSidebar');
     }
     $xtpl->assign('sidebar', $sidebar);
     $xtpl->parse('Page');
     return $xtpl->text('Page');
 }
开发者ID:biggtfish,项目名称:Sandbox,代码行数:26,代码来源:page.php


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