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

PHP XTemplate类代码示例

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

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



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

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


示例2: nv_block_video

 function nv_block_video()
 {
     global $global_config, $site_mods, $db, $module_name;
     $rVid = 1;
     $get_video_query = "SELECT * FROM `nv_vi_video_picture` WHERE `pictureid`={$rVid}";
     if (($query = $db->sql_query($get_video_query)) !== false) {
         if (($row = $db->sql_fetchrow($query)) !== false) {
             $rs = $row;
         }
     }
     if (!empty($rs['path']) and file_exists(NV_UPLOADS_REAL_DIR . "/" . "video" . $rs['path'])) {
         $rs['path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . "video" . $rs['path'];
     }
     if (!empty($rs['vpath']) and file_exists(NV_UPLOADS_REAL_DIR . "/" . "video" . $rs['vpath'])) {
         $rs['vpath'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . "video" . $rs['vpath'];
     }
     $block_theme = "default";
     $xtpl = new XTemplate("global.video.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks");
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $xtpl->assign('URL_PP', $rs['path']);
     $xtpl->assign('URL_V', $rs['vpath']);
     $xtpl->assign('VID_NAME', $rs['name']);
     $xtpl->assign('VID_DES', $rs['description']);
     $xtpl->assign('NUM_VVIEW', $rs['num_view']);
     $xtpl->assign('IMGP', NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/" . $module_name . "/");
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:28,代码来源:global.video.php


示例3: getEditor

 function getEditor()
 {
     $xtpl = new XTemplate(dirname(__FILE__) . '/editor.xtpl');
     $xtpl->parse('main.menu_item_list');
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:BackupTheBerlios,项目名称:freeblocks-svn,代码行数:7,代码来源:MenuDatasource.php


示例4: main_theme

/**
 * main_theme()
 *
 * @param mixed $contents
 * @return
 */
function main_theme($contents)
{
    if (empty($contents)) {
        return '';
    }
    global $global_config, $module_file;
    $xtpl = new XTemplate('cronjobs_list.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    foreach ($contents as $id => $values) {
        $xtpl->assign('DATA', array('caption' => $values['caption'], 'edit' => empty($values['edit']) ? array() : $values['edit'], 'disable' => empty($values['disable']) ? array() : $values['disable'], 'delete' => empty($values['delete']) ? array() : $values['delete'], 'id' => $id));
        if (!empty($values['edit'][0])) {
            $xtpl->parse('main.edit');
        }
        if (!empty($values['disable'][0])) {
            $xtpl->parse('main.disable');
        }
        if (!empty($values['delete'][0])) {
            $xtpl->parse('main.delete');
        }
        $a = 0;
        foreach ($values['detail'] as $key => $value) {
            $xtpl->assign('ROW', array('key' => $key, 'value' => $value));
            $xtpl->parse('main.loop');
        }
        $xtpl->parse('main');
    }
    return $xtpl->text('main');
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:33,代码来源:functions.php


示例5: nv_page_list

 /**
  * nv_page_list()
  *
  * @return
  */
 function nv_page_list($block_config)
 {
     global $global_config, $site_mods, $db, $module_name;
     $module = $block_config['module'];
     if (!isset($site_mods[$module])) {
         return '';
     }
     $db->sqlreset()->select('id, title, alias')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'])->where('status = 1')->order('weight ASC')->limit($block_config['numrow']);
     $list = nv_db_cache($db->sql(), 'id', $module);
     if (!empty($list)) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/page/block.page_list.tpl')) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/page/block.page_list.tpl')) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block.page_list.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/page');
         foreach ($list as $l) {
             $l['title_clean60'] = nv_clean60($l['title'], $block_config['title_length']);
             $l['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $l['alias'] . $global_config['rewrite_exturl'];
             $xtpl->assign('ROW', $l);
             $xtpl->parse('main.loop');
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     } else {
         return '';
     }
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:35,代码来源:global.page_list.php


示例6: nv_page_list

 /**
  * nv_page_list()
  *
  * @return
  */
 function nv_page_list($block_config)
 {
     global $global_config, $site_mods, $db, $module_name;
     $module = $block_config['module'];
     if (!isset($site_mods[$module])) {
         return '';
     }
     $db->sqlreset()->select('id, title, phone,phone1,image')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'])->where('status = 1')->order('weight ASC')->limit($block_config['numrow']);
     $list = nv_db_cache($db->sql(), 'id', $module);
     if (!empty($list)) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/nhan-vien/block.nhanvien.tpl')) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/nhan-vien/block.nhanvien.tpl')) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block.nhanvien.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/nhan-vien');
         foreach ($list as $l) {
             $l['img'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $l['image'];
             $xtpl->assign('ROW', $l);
             $xtpl->parse('main.loop');
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     } else {
         return '';
     }
 }
开发者ID:nukeplus,项目名称:support,代码行数:34,代码来源:global.page_list.php


示例7: execute

 function execute()
 {
     if ($this->user['user_level'] < USER_ADMIN) {
         return $this->error('Access Denied: You do not have permission to perform that action.');
     }
     $this->title('Banned IPs');
     if (!isset($this->post['submit'])) {
         $ips = null;
         if (isset($this->settings['banned_ips'])) {
             $ips = implode("\n", $this->settings['banned_ips']);
         }
         $xtpl = new XTemplate('./skins/' . $this->skin . '/AdminCP/ban.xtpl');
         $xtpl->assign('token', $this->generate_token());
         $xtpl->assign('ip_addresses', $ips);
         $xtpl->parse('Bans');
         return $xtpl->text('Bans');
     }
     if (!$this->is_valid_token()) {
         return $this->error('Invalid or expired security token. Please go back, reload the form, and try again.');
     }
     $banned_ips = trim($this->post['banned_ips']);
     if ($banned_ips) {
         $banned_ips = explode("\n", $banned_ips);
     } else {
         $banned_ips = array();
     }
     $this->settings['banned_ips'] = $banned_ips;
     $this->save_settings();
     return $this->message('Banned IPs', 'Bans updated.', 'Continue', 'admin.php?a=ban');
 }
开发者ID:biggtfish,项目名称:Sandbox,代码行数:30,代码来源:ban.php


示例8: nv_blog_news_tags

 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: cot_ukarma

function cot_ukarma($userid, $area = 'users', $code = '', $onlyscore = false)
{
    global $db, $cfg, $db_ukarma, $db_users;
    if ($area == 'users' && $db->fieldExists($db_users, "user_ukarma")) {
        $score = $db->query("SELECT user_ukarma FROM {$db_users} WHERE user_id=" . $userid)->fetchColumn();
    } else {
        $where['ukarma_userid'] = "ukarma_userid=" . $userid;
        if (!empty($area) && $area != 'users') {
            $where['ukarma_area'] = "ukarma_area='" . $area . "'";
        }
        if (!empty($code)) {
            $where['ukarma_code'] = "ukarma_code='" . $code . "'";
        }
        $where = $where ? 'WHERE ' . implode(' AND ', $where) : '';
        $score = $db->query("SELECT SUM(ukarma_value) FROM {$db_ukarma} {$where}")->fetchColumn();
    }
    if ($onlyscore) {
        return !empty($score) ? $score : 0;
    }
    if ($score > 0) {
        $sign = '+';
    } elseif ($score < 0) {
        $sign = '-';
    }
    $t = new XTemplate(cot_tplfile(array('ukarma', $area), 'plug'));
    $t->assign(cot_generate_usertags($userid, 'UKARMA_USER_'));
    $t->assign(array('UKARMA_AREA' => $area, 'UKARMA_CODE' => $code, 'UKARMA_SELECTOR' => 'ukarma_' . $userid . $area . $code, 'UKARMA_SCOREENABLED' => cot_ukarma_checkenablescore($userid, $area, $code), 'UKARMA_SCORE' => !empty($score) ? $score : 0, 'UKARMA_SCORE_ABS' => !empty($score) ? abs($score) : 0, 'UKARMA_SIGN' => $sign));
    $t->parse('MAIN');
    return $t->text('MAIN');
}
开发者ID:CrazyFreeMan,项目名称:cot-ukarma,代码行数:30,代码来源:ukarma.functions.php


示例10: nv_news_category

 function nv_news_category($block_config)
 {
     global $module_array_cat, $module_info, $lang_module, $global_config;
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/news/block_category.tpl')) {
         $block_theme = $global_config['module_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_category.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/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', $block_theme);
         $html = '';
         foreach ($module_array_cat as $cat) {
             if ($block_config['catid'] == 0 && $cat['parentid'] == 0 || $block_config['catid'] > 0 && $cat['parentid'] == $block_config['catid']) {
                 $html .= "<li>\n";
                 $html .= "<a title=\"" . $cat['title'] . "\" href=\"" . $cat['link'] . "\">" . nv_clean60($cat['title'], $title_length) . "</a>\n";
                 if (!empty($cat['subcatid'])) {
                     $html .= "<span class=\"fa arrow expand\"></span>";
                     $html .= nv_news_sub_category($cat['subcatid'], $title_length);
                 }
                 $html .= "</li>\n";
             }
         }
         $xtpl->assign('MENUID', $block_config['bid']);
         $xtpl->assign('HTML_CONTENT', $html);
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:nukeplus,项目名称:videos,代码行数:32,代码来源:global.block_category.php


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


示例12: process_page

 /**
  *
  */
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $currentModule;
     global $sugar_version, $sugar_config;
     $output_html = '';
     $where = '';
     $where = $this->_get_where_clause();
     $image_path = 'themes/' . $theme . '/images/';
     $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
     $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
     $user_name = empty($_REQUEST['user_name']) ? '' : $_REQUEST['user_name'];
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
     $button = "<form action='index.php' method='post' name='form' id='form'>\n";
     if (!$hide_clear_button) {
         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
     }
     $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
     $button .= "</form>\n";
     $form = new XTemplate('modules/Employees/Popup_picker.html');
     $form->assign('MOD', $mod_strings);
     $form->assign('APP', $app_strings);
     $form->assign('THEME', $theme);
     $form->assign('MODULE_NAME', $currentModule);
     $form->assign('FIRST_NAME', $first_name);
     $form->assign('LAST_NAME', $last_name);
     $form->assign('USER_NAME', $user_name);
     $form->assign('request_data', $request_data);
     ob_start();
     insert_popup_header($theme);
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
     $form->parse('main.SearchHeader');
     $output_html .= $form->text('main.SearchHeader');
     $output_html .= get_form_footer();
     // Reset the sections that are already in the page so that they do not print again later.
     $form->reset('main.SearchHeader');
     // create the listview
     $seed_bean = new Employee();
     $ListView = new ListView();
     $ListView->show_export_button = false;
     $ListView->process_for_popups = true;
     $ListView->setXTemplate($form);
     $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
     $ListView->setHeaderText($button);
     $ListView->setQuery($where, '', 'user_name', 'EMPLOYEE');
     $ListView->setModStrings($mod_strings);
     ob_start();
     $ListView->processListView($seed_bean, 'main', 'EMPLOYEE');
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_footer();
     $output_html .= insert_popup_footer();
     return $output_html;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:62,代码来源:Popup_picker.php


示例13: nv_theme_crawler_search

/**
 * nv_theme_crawler_search()
 * 
 * @param mixed $array_data
 * @return
 */
function nv_theme_crawler_search($array_data)
{
    global $global_config, $module_name, $module_file, $lang_module, $module_config, $module_info, $op;
    $xtpl = new XTemplate($op . ".tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:anhyeuviolet,项目名称:feednews,代码行数:14,代码来源:theme.php


示例14: sendcontact

/**
 * sendcontact()
 * 
 * @param mixed $url
 * @return
 */
function sendcontact($url)
{
    global $module_file, $global_config, $module_info, $lang_module;
    $xtpl = new XTemplate("sendcontact.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $lang_module['urlrefresh'] = $url;
    $xtpl->assign('LANG', $lang_module);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:15,代码来源:theme.php


示例15: sendcontact

/**
 * sendcontact()
 *
 * @param mixed $url
 * @return
 */
function sendcontact($url)
{
    global $module_file, $module_info, $lang_module;
    $xtpl = new XTemplate('sendcontact.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $lang_module['urlrefresh'] = nv_url_rewrite($url, true);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:15,代码来源:theme.php


示例16: nv_block_news_groups_multi_tabs

 function nv_block_news_groups_multi_tabs($block_config)
 {
     global $module_array_cat, $module_info, $site_mods, $module_config, $global_config, $db;
     $module = $block_config['module'];
     $show_no_image = $module_config[$module]['show_no_image'];
     $blockwidth = $module_config[$module]['blockwidth'];
     if (empty($block_config['blockid'])) {
         return '';
     }
     $blockid = implode(',', $block_config['blockid']);
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/news/block_groups_multi_tabs.tpl')) {
         $block_theme = $global_config['module_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_groups_multi_tabs.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/news');
     $n = 0;
     $sql = 'SELECT bid, title FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_block_cat WHERE bid IN ( ' . $blockid . ' ) ORDER BY weight ASC';
     $result = $db->query($sql);
     while ($data = $result->fetch()) {
         $n++;
         if ($n == 1) {
             $data['active'] = 'active';
         }
         $xtpl->assign('BLOCK_INFO', $data);
         $xtpl->parse('main.group_info');
         $db->sqlreset()->select('t1.id, t1.catid, t1.title, t1.alias, t1.homeimgfile, t1.homeimgthumb,t1.hometext,t1.publtime')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_rows t1')->join('INNER JOIN ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_block t2 ON t1.id = t2.id')->where('t2.bid= ' . $data['bid'] . ' AND t1.status= 1')->order('t2.weight ASC')->limit($block_config['numrow']);
         $list = nv_db_cache($db->sql(), '', $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 . '=' . $module_array_cat[$l['catid']]['alias'] . '/' . $l['alias'] . '-' . $l['id'] . $global_config['rewrite_exturl'];
                 if ($l['homeimgthumb'] == 1) {
                     $l['thumb'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $l['homeimgfile'];
                 } elseif ($l['homeimgthumb'] == 2) {
                     $l['thumb'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $l['homeimgfile'];
                 } elseif ($l['homeimgthumb'] == 3) {
                     $l['thumb'] = $l['homeimgfile'];
                 } elseif (!empty($show_no_image)) {
                     $l['thumb'] = NV_BASE_SITEURL . $show_no_image;
                 } else {
                     $l['thumb'] = '';
                 }
                 $l['bid'] = $data['bid'];
                 $l['blockwidth'] = $blockwidth;
                 $l['title'] = nv_clean60($l['title'], $block_config['title_length']);
                 $xtpl->assign('ROW', $l);
                 if (!empty($l['thumb'])) {
                     $xtpl->parse('main.group_content.loop.img');
                 }
                 $xtpl->parse('main.group_content.loop');
             }
             $xtpl->parse('main.group_content');
         }
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:hongoctrien,项目名称:module-videos,代码行数:57,代码来源:global.block_groups_multi_tabs.php


示例17: oks

/**
 * Success display function
 * @param array $oks Success messages
 * @param XTemplate $t1 XTemplate object
 */
function oks($oks, $t1)
{
    if (!empty($oks)) {
        foreach ($oks as $key => $msg) {
            $t1->assign('OK_ROW_MSG', $msg);
            $t1->parse('MAIN.OK.OK_ROW');
        }
        $t1->parse('MAIN.OK');
    }
}
开发者ID:olmprakash,项目名称:cot-openinviter,代码行数:15,代码来源:openinviter.php


示例18: nv_copyright_info

 /**
  * 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


示例19: nv_show_playlist_list

function nv_show_playlist_list($playlist_id)
{
    global $db, $lang_module, $lang_global, $module_name, $module_data, $op, $global_array_cat, $module_file, $module_config, $global_config;
    $xtpl = new XTemplate('playlist_list.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    $xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
    $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
    $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('OP', $op);
    $xtpl->assign('PLAYLIST_ID', $playlist_id);
    $global_array_cat[0] = array('alias' => 'Other');
    $sql = 'SELECT t1.id, t1.catid, t1.title, t1.alias, t2.playlist_sort FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows t1 INNER JOIN ' . NV_PREFIXLANG . '_' . $module_data . '_playlist t2 ON t1.id = t2.id WHERE t2.playlist_id= ' . $playlist_id . ' AND t1.status=1 ORDER BY t2.playlist_sort ASC';
    $array_block = $db->query($sql)->fetchAll();
    $num = sizeof($array_block);
    if ($num > 0) {
        foreach ($array_block as $row) {
            $xtpl->assign('ROW', array('id' => $row['id'], 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $global_array_cat[$row['catid']]['alias'] . '/' . $row['alias'] . '-' . $row['id'] . $global_config['rewrite_exturl'], 'title' => $row['title']));
            for ($i = 1; $i <= $num; ++$i) {
                $xtpl->assign('WEIGHT', array('key' => $i, 'title' => $i, 'selected' => $i == $row['playlist_sort'] ? ' selected="selected"' : ''));
                $xtpl->parse('list_videos.loop.playlist_sort');
            }
            $xtpl->parse('list_videos.loop');
        }
        $xtpl->parse('list_videos');
        $contents = $xtpl->text('list_videos');
    } else {
        $xtpl->parse('no_videos');
        $contents = $xtpl->text('no_videos');
    }
    return $contents;
}
开发者ID:webvangvn,项目名称:nv4_module_videos,代码行数:33,代码来源:site.functions.php


示例20: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     $template['file'] = ONXSHOP_DIR . "templates/{$this->GET['template']}";
     $tpl = new XTemplate($template['file']);
     $tpl->parse('title');
     $tpl->parse('description');
     $tpl->parse('keywords');
     $tpl->parse('head');
     $template['title'] = $tpl->text('title');
     $template['description'] = $tpl->text('description');
     $template['keywords'] = $tpl->text('keywords');
     $template['head'] = $tpl->text('head');
     if (file_exists($template['file'])) {
         $file_content = file($template['file']);
         foreach ($file_content as $file_line) {
             $proc = 1;
             if (preg_match('/<\\!-- BEGIN: content -->/', $file_line)) {
                 $add = 1;
                 $proc = 0;
             } else {
                 if (preg_match('/<\\!-- END: content -->/', $file_line)) {
                     $add = 0;
                 }
             }
             if ($add == 1 && $proc == 1) {
                 $template['content'] = $template['content'] . $file_line;
             }
         }
     } else {
         msg("template {$template['file']} does not exists!", 'error', 1);
     }
     $this->tpl->assign('template', $template);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:37,代码来源:edit_template.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XUtils类代码示例发布时间:2022-05-23
下一篇:
PHP XString类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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