本文整理汇总了PHP中nv_htmlspecialchars函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_htmlspecialchars函数的具体用法?PHP nv_htmlspecialchars怎么用?PHP nv_htmlspecialchars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_htmlspecialchars函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: nv_copyright_info_config
function nv_copyright_info_config()
{
global $lang_global, $data_block;
$html = '<tr>';
$html .= '<td>' . $lang_global['copyright_by'] . '</td>';
$html .= '<td><input type="text" name="copyright_by" value="' . nv_htmlspecialchars($data_block['copyright_by']) . '" size="80"></td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>' . $lang_global['copyright_url'] . '</td>';
$html .= '<td><input type="text" name="copyright_url" value="' . nv_htmlspecialchars($data_block['copyright_url']) . '" size="80"></td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>' . $lang_global['design_by'] . '</td>';
$html .= '<td><input type="text" name="design_by" value="' . nv_htmlspecialchars($data_block['design_by']) . '" size="80"></td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>' . $lang_global['design_url'] . '</td>';
$html .= '<td><input type="text" name="design_url" value="' . nv_htmlspecialchars($data_block['design_url']) . '" size="80"></td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>' . $lang_global['siteterms_url'] . '</td>';
$html .= '<td><input type="text" name="siteterms_url" value="' . nv_htmlspecialchars($data_block['siteterms_url']) . '" size="80"></td>';
$html .= '</tr>';
return $html;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:25,代码来源:global.copyright.php
示例2: nv_block_data_config_html
function nv_block_data_config_html($module, $data_block, $lang_block)
{
global $lang_module;
if (defined('NV_EDITOR')) {
require NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$htmlcontent = defined('NV_EDITOR') ? nv_editor_br2nl($data_block['htmlcontent']) : nv_br2nl($data_block['htmlcontent']);
$htmlcontent = nv_htmlspecialchars($htmlcontent);
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$html = nv_aleditor("htmlcontent", '100%', '150px', $htmlcontent);
} else {
$html = "<textarea style=\"width: 100%\" name=\"htmlcontent\" id=\"htmlcontent\" cols=\"20\" rows=\"8\">" . $htmlcontent . "</textarea>";
}
return '<tr><td colspan="2">' . $lang_block['htmlcontent'] . '<br>' . $html . '</td></tr>';
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:15,代码来源:global.html.php
示例3: nv_save_file_config_global
function nv_save_file_config_global()
{
global $db;
$content_config = "<?php\n\n";
$content_config .= NV_FILEHEAD . "\n\n";
$content_config .= "if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );\n\n";
$sql = "SELECT `config_name`, `config_value` FROM `" . NV_CONFIG_GLOBALTABLE . "` WHERE `lang`='sys' ORDER BY `config_name` ASC";
$result = $db->sql_query($sql);
while (list($c_config_name, $c_config_value) = $db->sql_fetchrow($result)) {
if (!is_numeric($c_config_value) || (isset($c_config_value[1]) and ($c_config_value[0] == '0' or $c_config_value[0] == '.'))) {
$content_config .= "\$global_config['" . $c_config_name . "'] = \"" . nv_htmlspecialchars($c_config_value) . "\";\n";
} else {
$content_config .= "\$global_config['" . $c_config_name . "'] = " . intval($c_config_value) . ";\n";
}
}
$content_config .= "\n";
$content_config .= "?>";
$return = file_put_contents(NV_ROOTDIR . "/" . NV_DATADIR . "/config_global.php", $content_config, LOCK_EX);
nv_delete_all_cache();
return $return;
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:21,代码来源:admin_functions.php
示例4: array
// Cau hinh hien thi nguon tin
$array_config_source = array($lang_module['config_source_title'], $lang_module['config_source_link'], $lang_module['config_source_logo']);
foreach ($array_config_source as $key => $val) {
$xtpl->assign('CONFIG_SOURCE', array('key' => $key, 'title' => $val, 'selected' => $key == $module_config[$module_name]['config_source'] ? ' selected="selected"' : ''));
$xtpl->parse('main.config_source');
}
$array_imgposition = array(0 => $lang_module['imgposition_0'], 1 => $lang_module['imgposition_1'], 2 => $lang_module['imgposition_2']);
// position images
while (list($id_imgposition, $title_imgposition) = each($array_imgposition)) {
$sl = $id_imgposition == $module_config[$module_name]['imgposition'] ? ' selected="selected"' : '';
$xtpl->assign('id_imgposition', $id_imgposition);
$xtpl->assign('title_imgposition', $title_imgposition);
$xtpl->assign('posl', $sl);
$xtpl->parse('main.looppos');
}
$copyright = nv_htmlspecialchars(nv_editor_br2nl($module_config[$module_name]['copyright']));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$_uploads_dir = NV_UPLOADS_DIR . '/' . $module_upload;
$copyright = nv_aleditor('copyright', '100%', '100px', $copyright, 'Basic', $_uploads_dir, $_uploads_dir);
} else {
$copyright = "<textarea style=\"width: 100%\" name=\"copyright\" id=\"copyright\" cols=\"20\" rows=\"15\">" . $copyright . "</textarea>";
}
$xtpl->assign('COPYRIGHTHTML', $copyright);
$xtpl->assign('PATH', defined('NV_IS_SPADMIN') ? "" : NV_UPLOADS_DIR . '/' . $module_upload);
$xtpl->assign('CURRENTPATH', defined('NV_IS_SPADMIN') ? "images" : NV_UPLOADS_DIR . '/' . $module_upload);
if (defined('NV_IS_ADMIN_FULL_MODULE') or !in_array('admins', $allow_func)) {
$groups_list = nv_groups_list();
unset($groups_list[6]);
$savepost = $nv_Request->get_int('savepost', 'post', 0);
if (!empty($savepost)) {
$array_config = array();
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:setting.php
示例5: nv_show_cat_list
}
global $array_cat, $numcat;
$contents = "<div id=\"module_show_list\">";
$contents .= nv_show_cat_list($array_cat, $numcat);
$contents .= "</div><br>\n";
$catid = isset($_GET['catid']) ? intval($_GET['catid']) : 0;
if ($catid > 0) {
list($catid, $parentid, $title, $catimage, $alias, $description, $keywords) = $db->sql_fetchrow($db->sql_query("SELECT `catid`, `parentid`, `title`, `catimage`, `alias`, `description`, `keywords` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_cat` where `catid`=" . $catid . ""));
$caption = $lang_module['edit_cat'];
$description = nv_br2nl($description);
} else {
$catimage = '';
$caption = $lang_module['add_cat'];
$parentid = 0;
}
$description = nv_htmlspecialchars($description);
if ($error != "") {
$contents .= "<div class=\"quote\" style=\"width:780px;\">\n";
$contents .= "<blockquote class=\"error\"><span>" . $error . "</span></blockquote>\n";
$contents .= "</div>\n";
$contents .= "<div class=\"clear\"></div>\n";
}
$contents .= "<form action=\"" . NV_BASE_ADMINURL . "index.php\" method=\"post\">";
$contents .= "<input type=\"hidden\" name =\"" . NV_NAME_VARIABLE . "\"value=\"" . $module_name . "\" />";
$contents .= "<input type=\"hidden\" name =\"" . NV_OP_VARIABLE . "\"value=\"" . $op . "\" />";
$contents .= "<input type=\"hidden\" name =\"catid\" value=\"" . $catid . "\" />";
$contents .= "<input type=\"hidden\" name =\"parentid_old\" value=\"" . $parentid . "\" />";
$contents .= "<input name=\"savecat\" type=\"hidden\" value=\"1\" />\n";
$contents .= "<table summary=\"\" class=\"tab1\">\n";
$contents .= "<caption>" . $caption . "</caption>\n";
$contents .= "<tr>";
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:cat.php
示例6: die
die('Stop!!!');
}
$page_title = $lang_module['content_list'];
$stype = $nv_Request->get_string('stype', 'get', '-');
$sstatus = $nv_Request->get_string('sstatus', 'get', '-');
$catid = $nv_Request->get_int('catid', 'get', 0);
$per_page_old = $nv_Request->get_int('per_page', 'cookie', 50);
$per_page = $nv_Request->get_int('per_page', 'get', $per_page_old);
if ($per_page < 1 and $per_page > 500) {
$per_page = 50;
}
if ($per_page_old != $per_page) {
$nv_Request->set_Cookie('per_page', $per_page, NV_LIVE_COOKIE_TIME);
}
$q = strip_tags($nv_Request->get_string('q', 'get', ''));
$qhtml = nv_htmlspecialchars($q);
$ordername = $nv_Request->get_string('ordername', 'get', 'publtime');
$order = $nv_Request->get_string('order', 'get') == "asc" ? 'asc' : 'desc';
$val_cat_content = array();
$val_cat_content[] = array("value" => 0, "selected" => $catid == 0 ? " selected=\"selected\"" : "", "title" => $lang_module['search_cat_all']);
$array_cat_view = array();
foreach ($global_array_cat as $catid_i => $array_value) {
$lev_i = $array_value['lev'];
$check_cat = false;
if (defined('NV_IS_ADMIN_MODULE')) {
$check_cat = true;
} elseif (isset($array_cat_admin[$admin_id][$catid_i])) {
if ($array_cat_admin[$admin_id][$catid_i]['admin'] == 1) {
$check_cat = true;
} elseif ($array_cat_admin[$admin_id][$catid_i]['add_content'] == 1) {
$check_cat = true;
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:main.php
示例7: mktime
if (!empty($endtime) && preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $endtime, $m)) {
$endtime = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
} else {
$endtime = 0;
}
$notice = filter_text_input('notice', 'post', '', 1);
if (empty($error)) {
if ($cid > 0) {
$db->sql_query("UPDATE `" . $db_config['prefix'] . "_banip` SET `ip`=" . $db->dbescape($ip) . ", `mask`=" . $db->dbescape($mask) . ",`area`=" . $area . ",`begintime`=" . $begintime . ", `endtime`=" . $endtime . ", `notice`=" . $db->dbescape($notice) . " WHERE `id`=" . $cid . "");
} else {
$db->sql_query("REPLACE INTO `" . $db_config['prefix'] . "_banip` VALUES (NULL, " . $db->dbescape($ip) . "," . $db->dbescape($mask) . ",{$area},{$begintime}, {$endtime}," . $db->dbescape($notice) . " )");
}
$save = nv_save_file_banip();
if ($save !== true) {
$xtpl->assign('MESSAGE', sprintf($lang_module['banip_error_write'], NV_DATADIR, NV_DATADIR));
$xtpl->assign('CODE', str_replace(array("\n", "\t"), array("<br />", " "), nv_htmlspecialchars($save)));
$xtpl->parse('main.manual_save');
} else {
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
die;
}
} else {
$xtpl->assign('ERROR', implode('<br/>', $error));
$xtpl->parse('main.error');
}
} else {
$id = $ip = $mask = $area = $begintime = $endtime = $notice = '';
}
$mask_text_array = array();
$mask_text_array[0] = "255.255.255.255";
$mask_text_array[3] = "255.255.255.xxx";
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:banip.php
示例8: sprintf
$error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
}
} elseif ($row_f['match_type'] == 'regex') {
if (!preg_match("/" . $row_f['match_regex'] . "/", $value)) {
$error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
}
} elseif ($row_f['match_type'] == 'callback') {
if (function_exists($row_f['func_callback'])) {
if (!call_user_func($row_f['func_callback'], $value)) {
$error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
}
} else {
$error = "error function not exists " . $row_f['func_callback'];
}
} else {
$value = nv_htmlspecialchars($value);
}
$strlen = nv_strlen($value);
if ($strlen < $row_f['min_length'] or $strlen > $row_f['max_length']) {
$error = sprintf($lang_module['field_min_max_error'], $row_f['title'], $row_f['min_length'], $row_f['max_length']);
}
} elseif ($row_f['question_type'] == 'textarea' or $row_f['question_type'] == 'editor') {
$allowed_html_tags = array_map("trim", explode(',', NV_ALLOWED_HTML_TAGS));
$allowed_html_tags = "<" . implode("><", $allowed_html_tags) . ">";
$value = strip_tags($value, $allowed_html_tags);
$value = nv_nl2br($value, '<br />');
if ($row_f['match_type'] == 'regex') {
if (!preg_match("/" . $row_f['match_regex'] . "/", $value)) {
$error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
}
} elseif ($row_f['match_type'] == 'callback') {
开发者ID:hoangvtien,项目名称:module-nvform,代码行数:31,代码来源:form.check.php
示例9: foreach
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('main.error');
}
if (!empty($array_cat_list)) {
if (empty($alias)) {
$xtpl->parse('main.content.getalias');
}
foreach ($cat_listsub as $data) {
$xtpl->assign('cat_listsub', $data);
$xtpl->parse('main.content.cat_listsub');
}
foreach ($groups_views as $data) {
$xtpl->assign('groups_views', $data);
$xtpl->parse('main.content.groups_views');
}
$descriptionhtml = nv_htmlspecialchars(nv_editor_br2nl($descriptionhtml));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$_uploads_dir = NV_UPLOADS_DIR . '/' . $module_upload;
$descriptionhtml = nv_aleditor('descriptionhtml', '100%', '200px', $descriptionhtml, 'Basic', $_uploads_dir, $_uploads_dir);
} else {
$descriptionhtml = "<textarea style=\"width: 100%\" name=\"descriptionhtml\" id=\"descriptionhtml\" cols=\"20\" rows=\"15\">" . $descriptionhtml . "</textarea>";
}
$xtpl->assign('DESCRIPTIONHTML', $descriptionhtml);
$xtpl->parse('main.content');
}
$xtpl->parse('main');
$contents .= $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:cat.php
示例10: array
}
}
}
} else {
$full_name = $alias = $phone = $fax = $email = $yahoo = $skype = $note = '';
$view_level = $reply_level = $obt_level = array();
foreach ($adms as $admid => $values) {
if ($values['level'] === 1) {
$view_level[] = $admid;
$reply_level[] = $admid;
}
}
}
}
if (!empty($note)) {
$note = nv_htmlspecialchars($note);
}
if (empty($row['alias'])) {
$xtpl->parse('main.get_alias');
}
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('main.error');
}
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$note = nv_aleditor('note', '100%', '150px', $note);
} else {
$note = '<textarea style="width:100%;height:150px" name="note" id="note">' . $note . '</textarea>';
}
$xtpl->assign('DATA', array('full_name' => $full_name, 'alias' => $alias, 'phone' => $phone, 'fax' => $fax, 'email' => $email, 'yahoo' => $yahoo, 'skype' => $skype, 'note' => $note));
//list danh sách bộ phận liên hệ
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:row.php
示例11: foreach
foreach ($array_typeprice as $key => $value) {
$ck = $data['typeprice'] == $key ? 'checked="checked"' : '';
$xtpl->assign('TYPEPRICE', array('key' => $key, 'value' => $value, 'checked' => $ck));
$xtpl->parse('main.typeprice_loop');
}
if ($pro_config['point_active']) {
$xtpl->parse('main.point');
}
if (!empty($cat_form_exit)) {
foreach ($cat_form_exit as $_form) {
$xtpl->assign('CAT_FORM', array('value' => $_form, 'selected' => $data['form'] == $_form ? ' selected="selected"' : '', 'title' => $_form));
$xtpl->parse('main.cat_form.loop');
}
$xtpl->parse('main.cat_form');
}
$descriptionhtml = nv_htmlspecialchars(nv_editor_br2nl($data[NV_LANG_DATA . '_descriptionhtml']));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$descriptionhtml = nv_aleditor('descriptionhtml', '100%', '200px', $descriptionhtml, 'Basic');
} else {
$descriptionhtml = "<textarea style=\"width: 100%\" name=\"descriptionhtml\" id=\"descriptionhtml\" cols=\"20\" rows=\"15\">" . $descriptionhtml . "</textarea>";
}
$xtpl->assign('DESCRIPTIONHTML', $descriptionhtml);
for ($i = 0; $i <= 2; $i++) {
$xtpl->assign('VIEWDESCRIPTION', array('value' => $i, 'checked' => $data['viewdescriptionhtml'] == $i ? ' checked="checked"' : '', 'title' => $lang_module['content_bodytext_display_' . $i]));
$xtpl->parse('main.viewdescriptionhtml');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:nukeplus,项目名称:shops,代码行数:31,代码来源:cat.php
示例12: nv_insert_logs
$count = $stmt->rowCount();
}
if ($count) {
nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['edit_title'] . ': ' . $row['module'] . ', id: ' . $row['id'] . ', cid: ' . $row['cid'], $row['content'], $admin_info['userid']);
if (isset($site_mods[$row['module']])) {
$mod_info = $site_mods[$row['module']];
if (file_exists(NV_ROOTDIR . '/modules/' . $mod_info['module_file'] . '/comment.php')) {
include NV_ROOTDIR . '/modules/' . $mod_info['module_file'] . '/comment.php';
nv_del_moduleCache($row['module']);
}
}
}
header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name);
die;
}
$row['content'] = nv_htmlspecialchars(nv_br2nl($row['content']));
$row['status'] = $row['status'] ? 'checked="checked"' : '';
$xtpl = new XTemplate('edit.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('MODULE_NAME', $module_name);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('OP', $op);
$xtpl->assign('CID', $cid);
$xtpl->assign('ROW', $row);
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
开发者ID:volong1012,项目名称:nukeviet,代码行数:31,代码来源:edit.php
示例13: elseif
}
} elseif (empty($id)) {
$row['image'] = '';
$row['imagealt'] = '';
$row['imageposition'] = 0;
$row['layout_func'] = '';
$row['description'] = '';
$row['bodytext'] = '';
$row['activecomm'] = $module_config[$module_name]['setcomm'];
$row['socialbutton'] = 1;
$row['gid'] = 0;
}
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$row['description'] = nv_htmlspecialchars(nv_br2nl($row['description']));
$row['bodytext'] = htmlspecialchars(nv_editor_br2nl($row['bodytext']));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$row['bodytext'] = nv_aleditor('bodytext', '100%', '300px', $row['bodytext']);
} else {
$row['bodytext'] = '<textarea style="width:100%;height:300px" name="bodytext">' . $row['bodytext'] . '</textarea>';
}
if (!empty($row['image']) and is_file(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $row['image'])) {
$row['image'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['image'];
}
$lang_global['title_suggest_max'] = sprintf($lang_global['length_suggest_max'], 65);
$lang_global['description_suggest_max'] = sprintf($lang_global['length_suggest_max'], 160);
$xtpl = new XTemplate('content.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$xtpl->assign('FORM_ACTION', $action);
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:content.php
示例14: implode
if ($value == 0) {
$rbcontents[] = "Disallow: " . $key;
}
}
if ($global_config['is_url_rewrite']) {
$rbcontents[] = "Sitemap: " . $global_config['site_url'] . "/index.php/SitemapIndex" . $global_config['rewrite_endurl'];
} else {
$rbcontents[] = "Sitemap: " . $global_config['site_url'] . "/index.php?" . NV_NAME_VARIABLE . "=SitemapIndex";
}
$rbcontents = implode("\n", $rbcontents);
if (is_writable(NV_ROOTDIR . "/robots.txt")) {
file_put_contents(NV_ROOTDIR . "/robots.txt", $rbcontents, LOCK_EX);
$redirect = true;
} else {
$xtpl->assign('TITLE', $lang_module['robots_error_writable']);
$xtpl->assign('CONTENT', str_replace(array("\n", "\t"), array("<br />", " "), nv_htmlspecialchars($rbcontents)));
$xtpl->parse('main.nowrite');
}
}
if ($redirect) {
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
exit;
}
}
$robots_data = array();
if (file_exists($cache_file)) {
include $cache_file;
$robots_data = unserialize($cache);
} else {
$robots_data['/' . NV_CACHEDIR . '/'] = 0;
$robots_data['/' . NV_DATADIR . '/'] = 0;
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:robots.php
示例15: contact_main_theme
/**
* main_theme()
*
* @param mixed $array_content
* @param mixed $array_department
* @param mixed $base_url
* @param mixed $checkss
* @return
*/
function contact_main_theme($array_content, $array_department, $catsName, $base_url, $checkss)
{
global $module_file, $lang_global, $lang_module, $module_info;
$xtpl = new XTemplate('main.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$xtpl->assign('CHECKSS', $checkss);
$xtpl->assign('CONTENT', $array_content);
if (!empty($array_content['bodytext'])) {
$xtpl->parse('main.bodytext');
}
if (!empty($array_department)) {
foreach ($array_department as $dep) {
$xtpl->assign('DEP', $dep);
if (!empty($dep['note'])) {
$xtpl->parse('main.dep.note');
}
if (!empty($dep['phone'])) {
$nums = array_map("trim", explode("|", nv_unhtmlspecialchars($dep['phone'])));
foreach ($nums as $k => $num) {
unset($m);
if (preg_match("/^(.*)\\s*\\[([0-9\\+\\.\\,\\;\\*\\#]+)\\]\$/", $num, $m)) {
$phone = array('number' => nv_htmlspecialchars($m[1]), 'href' => $m[2]);
$xtpl->assign('PHONE', $phone);
$xtpl->parse('main.dep.phone.item.href');
$xtpl->parse('main.dep.phone.item.href2');
} else {
$num = preg_replace("/\\[[^\\]]*\\]/", "", $num);
$phone = array('number' => nv_htmlspecialchars($num));
$xtpl->assign('PHONE', $phone);
}
if ($k) {
$xtpl->parse('main.dep.phone.item.comma');
}
$xtpl->parse('main.dep.phone.item');
}
$xtpl->parse('main.dep.phone');
}
if (!empty($dep['fax'])) {
$xtpl->parse('main.dep.fax');
}
if (!empty($dep['email'])) {
$emails = array_map("trim", explode(",", $dep['email']));
foreach ($emails as $k => $email) {
$xtpl->assign('EMAIL', $email);
if ($k) {
$xtpl->parse('main.dep.email.item.comma');
}
$xtpl->parse('main.dep.email.item');
}
$xtpl->parse('main.dep.email');
}
if (!empty($dep['others'])) {
$others = json_decode($dep['others'], true);
if (!empty($others)) {
foreach ($others as $key => $value) {
if (!empty($value)) {
if (strtolower($key) == "yahoo") {
$ys = array_map("trim", explode(",", $value));
foreach ($ys as $k => $y) {
$xtpl->assign('YAHOO', array('name' => $key, 'value' => $y));
if ($k) {
$xtpl->parse('main.dep.yahoo.item.comma');
}
$xtpl->parse('main.dep.yahoo.item');
}
$xtpl->parse('main.dep.yahoo');
} elseif (strtolower($key) == "skype") {
$ss = array_map("trim", explode(",", $value));
foreach ($ss as $k => $s) {
$xtpl->assign('SKYPE', array('name' => $key, 'value' => $s));
if ($k) {
$xtpl->parse('main.dep.skype.item.comma');
}
$xtpl->parse('main.dep.skype.item');
}
$xtpl->parse('main.dep.skype');
} elseif (strtolower($key) == "viber") {
$ss = array_map("trim", explode(",", $value));
foreach ($ss as $k => $s) {
$xtpl->assign('VIBER', array('name' => $key, 'value' => $s));
if ($k) {
$xtpl->parse('main.dep.viber.item.comma');
}
$xtpl->parse('main.dep.viber.item');
}
$xtpl->parse('main.dep.viber');
} elseif (strtolower($key) == "icq") {
$ss = array_map("trim", explode(",", $value));
foreach ($ss as $k => $s) {
$xtpl->assign('ICQ', array('name' => $key, 'value' => $s));
//.........这里部分代码省略.........
开发者ID:hocviettut,项目名称:to-giac-tp,代码行数:101,代码来源:theme.php
示例16: nv_rss_generate
/**
* nv_rss_generate()
*
* @param mixed $channel
* @param mixed $items
* @return void
*/
function nv_rss_generate($channel, $items)
{
global $db, $global_config, $client_info;
$xtpl = new XTemplate('rss.tpl', NV_ROOTDIR . '/themes/default/layout/');
$xtpl->assign('CSSPATH', NV_BASE_SITEURL . 'themes/default/css/rss.xsl');
//Chi co tac dung voi IE6 va Chrome
$channel['title'] = nv_htmlspecialchars($channel['title']);
$channel['atomlink'] = str_replace('&', '&', $client_info['selfurl']);
$channel['lang'] = $global_config['site_lang'];
$channel['copyright'] = $global_config['site_name'];
$channel['docs'] = NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=rss', true);
$channel['generator'] = 'Nukeviet Version 4';
if (preg_match('/^' . nv_preg_quote(NV_MY_DOMAIN . NV_BASE_SITEURL) . '(.+)$/', $channel['link'], $matches)) {
$channel['link'] = $matches[1];
} elseif (preg_match('/^' . nv_preg_quote(NV_BASE_SITEURL) . '(.+)$/', $channel['link'], $matches)) {
$channel['link'] = $matches[1];
}
$channel['link'] = NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . $channel['link'], true);
if (preg_match('/^' . nv_preg_quote(NV_MY_DOMAIN . NV_BASE_SITEURL) . '(.+)$/', $channel['atomlink'], $matches)) {
$channel['atomlink'] = $matches[1];
} elseif (preg_match('/^' . nv_preg_quote(NV_BASE_SITEURL) . '(.+)$/', $channel['atomlink'], $matches)) {
$channel['atomlink'] = $matches[1];
}
$channel['atomlink'] = NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . $channel['atomlink'], true);
$channel['pubDate'] = 0;
if (!empty($items)) {
foreach ($items as $item) {
if (!empty($item['title']) and !empty($item['link'])) {
$item['title'] = nv_htmlspecialchars($item['title']);
if (isset($item['pubdate']) and !empty($item['pubdate'])) {
$item['pubdate'] = intval($item['pubdate']);
$channel['pubDate'] = max($channel['pubDate'], $item['pubdate']);
$item['pubdate'] = gmdate('D, j M Y H:m:s', $item['pubdate']) . ' GMT';
}
if (preg_match('/^' . nv_preg_quote(NV_MY_DOMAIN . NV_BASE_SITEURL) . '(.+)$/', $item['link'], $matches)) {
$item['link'] = $matches[1];
} elseif (preg_match('/^' . nv_preg_quote(NV_BASE_SITEURL) . '(.+)$/', $item['link'], $matches)) {
$item['link'] = $matches[1];
}
$item['link'] = NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . $item['link'], true);
$xtpl->assign('ITEM', $item);
if (isset($item['guid']) and !empty($item['guid'])) {
$xtpl->parse('main.item.guid');
}
if (isset($item['pubdate']) and !empty($item['pubdate'])) {
$xtpl->parse('main.item.pubdate');
}
$xtpl->parse('main.item');
}
}
}
$lastModified = NV_CURRENTTIME;
if (!empty($channel['pubDate'])) {
$lastModified = $channel['pubDate'];
$channel['pubDate'] = gmdate('D, j M Y H:m:s', $channel['pubDate']) . ' GMT';
}
$xtpl->assign('CHANNEL', $channel);
if (!empty($channel['description'])) {
$xtpl->parse('main.description');
}
if (!empty($channel['pubDate'])) {
$xtpl->parse('main.pubDate');
}
$image = file_exists(NV_ROOTDIR . '/' . $global_config['site_logo']) ? NV_ROOTDIR . '/' . $global_config['site_logo'] : NV_ROOTDIR . '/images/logo.png';
$image = nv_ImageInfo($image, 144, true, NV_UPLOADS_REAL_DIR);
if (!empty($image)) {
$resSize = nv_imageResize($image['width'], $image['height'], 144, 400);
$image['width'] = $resSize['width'];
$image['height'] = $resSize['height'];
$image['title'] = $channel['title'];
$image['link'] = $channel['link'];
$image['src'] = NV_MY_DOMAIN . nv_url_rewrite($image['src'], true);
$xtpl->assign('IMAGE', $image);
$xtpl->parse('main.image');
}
$xtpl->parse('main');
$content = $xtpl->text('main');
nv_xmlOutput($content, $lastModified);
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:86,代码来源:theme_functions.php
示例17: in_array
// Captcha
$gfx_chk = in_array($global_config['gfx_chk'], array(3, 4, 6, 7)) ? 1 : 0;
$array_register = array();
$array_register['checkss'] = md5($client_info['session_id'] . $global_config['sitekey']);
$array_register['nv_redirect'] = $nv_redirect;
$checkss = $nv_Request->get_title('checkss', 'post', '');
// Dang ky thong thuong
$page_title = $lang_module['register'];
$key_words = $module_info['keywords'];
$mod_title = $lang_module['register'];
$array_field_config = array();
$result_field = $db->query('SELECT * FROM ' . NV_USERS_GLOBALTABLE . '_field ORDER BY weight ASC');
while ($row_field = $result_field->fetch()) {
$language = unserialize($row_field['language']);
$row_field['title'] = isset($language[NV_LANG_DATA]) ? $language[NV_LANG_DATA][0] : $row['field'];
$row_field['description'] = isset($language[NV_LANG_DATA]) ? nv_htmlspecialchars($language[NV_LANG_DATA][1]) : '';
if (!empty($row_field['field_choices'])) {
$row_field['field_choices'] = unserialize($row_field['field_choices']);
} elseif (!empty($row_field['sql_choices'])) {
$row_field['sql_choices'] = explode('|', $row_field['sql_choices']);
$query = 'SELECT ' . $row_field['sql_choices'][2] . ', ' . $row_field['sql_choices'][3] . ' FROM ' . $row_field['sql_choices'][1];
$result = $db->query($query);
$weight = 0;
while (list($key, $val) = $result->fetch(3)) {
$row_field['field_choices'][$key] = $val;
}
}
$array_field_config[] = $row_field;
}
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:register.php
示例18: redriect
} else {
$url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
$msg1 = $lang_module['content_saveok'];
$msg2 = $lang_module['content_main'] . ' ' . $module_info['custom_title'];
redriect($msg1, $msg2, $url, $module_data . '_bodyhtml');
}
}
} else {
$url = 'javascript: history.go(-1)';
$msg1 = implode('<br />', $error);
$msg2 = $lang_module['content_back'];
redriect($msg1, $msg2, $url, $module_data . '_bodyhtml', 'back');
}
$id_block_content = $id_block_content_post;
}
$rowcontent['hometext'] = nv_htmlspecialchars(nv_br2nl($rowcontent['hometext']));
$rowcontent['bodyhtml'] = htmlspecialchars(nv_editor_br2nl($rowcontent['bodyhtml']));
if (!empty($rowcontent['homeimgfile']) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/img/' . $rowcontent['homeimgfile'])) {
$rowcontent['homeimgfile'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/img/' . $rowcontent['homeimgfile'];
}
if (!empty($rowcontent['vid_path']) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/vid/' . $rowcontent['vid_path'])) {
$rowcontent['vid_path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/vid/' . $rowcontent['vid_path'];
}
$array_catid_in_row = explode(',', $rowcontent['listcatid']);
$sql = 'SELECT sourceid, title FROM ' . NV_PREFIXLANG . '_' . $module_data . '_sources ORDER BY weight ASC';
$result = $db->query($sql);
$array_source_module = array();
$array_source_module[0] = $lang_module['sources_sl'];
while (list($sourceid_i, $title_i) = $result->fetch(3)) {
$array_source_module[$sourceid_i] = $title_i;
}
开发者ID:webvangvn,项目名称:nv4_module_videos,代码行数:31,代码来源:content.php
示例19: date
} else {
$mess_content .= "<br /><br />----------<br />Best regards,<br /><br />" . $admin_name . "<br />";
if (!empty($admin_info['position'])) {
$mess_content .= $admin_info['position'] . "<br />";
}
$mess_content .= "<br />";
$mess_content .= "E-mail: " . $admin_info['email'] . "<br />";
$mess_content .= "Website: " . $global_config['site_name'] . "<br />" . $global_config['site_url'] . "<br /><br />";
$mess_content .= "--------------------------------------------------------------------------------<br />";
$mess_content .= "<strong>From:</strong> " . $row['sender_name'] . " [mailto:" . $row['sender_email'] . "]<br />";
$mess_content .= "<strong>Sent:</strong> " . date("r", $row['send_time']) . "<br />";
$mess_content .= "<strong>To:</strong> " . $contact_allowed['view'][$row['cid']] . "<br />";
$mess_content .= "<strong>Subject:</strong> " . $row['title'] . "<br /><br />";
$mess_content .= $row['content'];
}
$mess_content = nv_htmlspecialchars($mess_content);
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$mess_content = nv_aleditor("mess_content", '100%', '300px', $mess_content);
} else {
$mess_content = "<textarea style=\"width:99%\" name=\"mess_content\" id=\"mess_content\" cols=\"20\" rows=\"8\">" . $mess_content . "</textarea>";
}
$xtpl->assign('FORM_ACTION', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op . "&id=" . $id);
$xtpl->assign('MESS_CONTENT', $mess_content);
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('main.error');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . "/includes/header.php";
echo nv_admin_theme($contents);
|
请发表评论