本文整理汇总了PHP中nv_editor_br2nl函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_editor_br2nl函数的具体用法?PHP nv_editor_br2nl怎么用?PHP nv_editor_br2nl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_editor_br2nl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 = htmlspecialchars(nv_editor_br2nl($data_block['htmlcontent']));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$html = nv_add_editor_js() . 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>';
}
示例2: die
die(json_encode(array('status' => 'ok', 'input' => '', 'mess' => $lang_module['sendcontactok'])));
}
die(json_encode(array('status' => 'error', 'input' => '', 'mess' => $lang_module['sendcontactfailed'])));
}
$page_title = $module_info['custom_title'];
$key_words = $module_info['keywords'];
$mod_title = isset($lang_module['main_title']) ? $lang_module['main_title'] : $module_info['custom_title'];
$full_theme = true;
$base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
if (!empty($alias_department)) {
$base_url .= '&' . NV_OP_VARIABLE . '=' . $alias_department;
if (isset($array_op[1]) and $array_op[1] == 0) {
$base_url .= '/0';
$full_theme = false;
}
}
$base_url_rewrite = nv_url_rewrite($base_url, true);
if ($_SERVER['REQUEST_URI'] == $base_url_rewrite) {
$canonicalUrl = NV_MAIN_DOMAIN . $base_url_rewrite;
} elseif (NV_MAIN_DOMAIN . $_SERVER['REQUEST_URI'] != $base_url_rewrite) {
Header('Location: ' . $base_url_rewrite);
die;
} else {
$canonicalUrl = $base_url_rewrite;
}
$array_content = array('fname' => $fname, 'femail' => $femail, 'fphone' => $fphone);
$array_content['bodytext'] = isset($module_config[$module_name]['bodytext']) ? nv_editor_br2nl($module_config[$module_name]['bodytext']) : '';
$contents = contact_main_theme($array_content, $array_department, $catsName, $base_url, NV_CHECK_SESSION);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents, $full_theme);
include NV_ROOTDIR . '/includes/footer.php';
示例3: 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';
示例4: nv_editor_nl2br
} else {
$content = nv_editor_nl2br($content);
if ($mode == "edit") {
$query = "UPDATE `" . NV_USERS_GLOBALTABLE . "_config` SET \n `content`=" . $db->dbescape($content) . ", \n `edit_time`='" . NV_CURRENTTIME . "' \n WHERE `config` ='siteterms_" . NV_LANG_DATA . "'";
} else {
$query = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_config` VALUES( \n 'siteterms_" . NV_LANG_DATA . "', " . $db->dbescape($content) . ", " . NV_CURRENTTIME . ")";
}
$db->sql_query($query);
if ($db->sql_affectedrows() > 0) {
$error = $lang_module['saveok'];
} else {
$error = $lang_module['errorsave'];
}
}
} else {
$content = nv_editor_br2nl($row['content']);
}
if (!empty($content)) {
$content = nv_htmlspecialchars($content);
}
$xtpl = new XTemplate("siteterms.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', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('main.error');
}
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$data = nv_aleditor("content", '100%', '300px', $content);
} else {
示例5: 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();
示例6: die
die('OK');
} else {
die($lang_module['errorsave']);
}
}
if ($nv_Request->isset_request('edit', 'get')) {
$post = $groupsList[$post['id']];
$post['content'] = nv_editor_br2nl($post['content']);
$post['exp_time'] = !empty($post['exp_time']) ? date('d/m/Y', $post['exp_time']) : '';
$post['publics'] = $post['publics'] ? ' checked="checked"' : '';
$post['siteus'] = $post['siteus'] ? ' checked="checked"' : '';
} else {
$post['title'] = $post['content'] = $post['exp_time'] = '';
$post['publics'] = '';
}
$post['content'] = htmlspecialchars(nv_editor_br2nl($post['content']));
$xtpl->assign('DATA', $post);
if (defined('NV_CONFIG_DIR') and empty($global_config['idsite'])) {
$xtpl->parse('add.siteus');
}
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$_cont = nv_aleditor('content', '100%', '300px', $post['content']);
} else {
$_cont = '<textarea style="width:100%;height:300px" name="content" id="content">' . $post['content'] . '</textarea>';
}
$xtpl->assign('CONTENT', $_cont);
$xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
$xtpl->assign('NV_LANG_INTERFACE', NV_LANG_INTERFACE);
$xtpl->parse('add');
$contents = $xtpl->text('add');
} else {
示例7: 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);
$xtpl->assign('UPLOADS_DIR_USER', NV_UPLOADS_DIR . '/' . $module_upload);
示例8: foreach
$xtpl->parse('main.layout');
}
foreach ($array_status as $key_i => $name_i) {
$xtpl->assign('INHOME', array('key' => $key_i, 'name' => $name_i, 'selected' => $key_i == $data['inhome'] ? 'selected="selected"' : ''));
$xtpl->parse('main.inhome');
}
foreach ($array_status as $key => $name) {
$xtpl->assign('STATUS', array('key' => $key, 'name' => $name, 'selected' => $key == $data['status'] ? 'selected="selected"' : ''));
$xtpl->parse('main.status');
}
$groups_view = explode(',', $data['groups_view']);
foreach ($groups_list as $_group_id => $_title) {
$xtpl->assign('GROUPS_VIEW', array('value' => $_group_id, 'checked' => in_array($_group_id, $groups_view) ? ' checked="checked"' : '', 'title' => $_title));
$xtpl->parse('main.groups_view');
}
$data['description'] = htmlspecialchars(nv_editor_br2nl($data['description']));
if (defined('NV_EDITOR') and function_exists('nv_aleditor')) {
$edits = nv_aleditor('description', '100%', '150px', $data['description'], 'Basic');
} else {
$edits = "<textarea style=\"width: 100%\" name=\"description\" id=\"description\" cols=\"20\" rows=\"15\">" . $data['description'] . "</textarea>";
}
$xtpl->assign('edit_description', $edits);
if (empty($data['alias'])) {
$xtpl->parse('main.getalias');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
exit;
示例9: nv_insert_logs
$error = $lang_module['file_error1'];
} else {
if ($report and $array['is_del_report']) {
$sql = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_report` WHERE `fid`=" . $id;
$db->sql_query($sql);
}
nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['download_editfile'], $array['title'], $admin_info['userid']);
Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name);
exit;
}
}
$array['fileupload'] = !empty($array['fileupload']) ? explode("[NV]", $array['fileupload']) : array();
} else {
$array['catid'] = (int) $row['catid'];
$array['title'] = $row['title'];
$array['description'] = nv_editor_br2nl($row['description']);
$array['introtext'] = nv_br2nl($row['introtext']);
$array['author_name'] = $row['author_name'];
$array['author_email'] = $row['author_email'];
$array['author_url'] = $row['author_url'];
$array['fileupload'] = $row['fileupload'];
$array['linkdirect'] = $row['linkdirect'];
$array['version'] = $row['version'];
$array['filesize'] = (int) $row['filesize'];
$array['fileimage'] = $row['fileimage'];
$array['copyright'] = $row['copyright'];
$array['comment_allow'] = (int) $row['comment_allow'];
$array['who_comment'] = (int) $row['who_comment'];
$array['groups_comment'] = $row['groups_comment'];
$array['who_view'] = (int) $row['who_view'];
$array['groups_view'] = $row['groups_view'];
示例10: strlen
if ($mode == 'edit') {
$stmt = $db->prepare("UPDATE " . NV_MOD_TABLE . "_config SET\n\t\t\t\tcontent= :content,\n\t\t\t\tedit_time='" . NV_CURRENTTIME . "'\n\t\t\t\tWHERE config ='siteterms_" . NV_LANG_DATA . "'");
$stmt->bindParam(':content', $content, PDO::PARAM_STR, strlen($content));
$stmt->execute();
} else {
$stmt = $db->prepare("INSERT INTO " . NV_MOD_TABLE . "_config VALUES (\n\t\t\t\t'siteterms_" . NV_LANG_DATA . "', :content, " . NV_CURRENTTIME . ")");
}
$stmt->bindParam(':content', $content, PDO::PARAM_STR, strlen($content));
if ($stmt->execute()) {
$error = $lang_module['saveok'];
} else {
$error = $lang_module['errorsave'];
}
}
}
$content = htmlspecialchars(nv_editor_br2nl($content));
$xtpl = new XTemplate('siteterms.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', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('main.error');
}
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$data = nv_aleditor('content', '100%', '300px', $content);
} else {
$data = '<textarea style="width: 100%" name="content" id="content" cols="20" rows="8">' . $content . '</textarea>';
}
$xtpl->assign('DATA', $data);
$xtpl->parse('main');
示例11: nv_show_custom_form
/**
* nv_show_custom_form()
*
* @param mixed $is_edit
* @param mixed $form
* @param mixed $array_custom
* @param mixed $array_custom_lang
* @return
*/
function nv_show_custom_form($is_edit, $form, $array_custom)
{
global $db, $db_config, $lang_module, $lang_global, $module_name, $module_data, $op, $global_array_shops_cat, $global_config, $module_file;
$xtpl = new XTemplate('cat_form_' . $form . '.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);
if (preg_match('/^[a-zA-Z0-9\\-\\_]+$/', $form) and file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/admin/cat_form_' . $form . '.php')) {
require_once NV_ROOTDIR . '/modules/' . $module_file . '/admin/cat_form_' . $form . '.php';
}
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$array_custom_lang = array();
$idtemplate = $db->query('SELECT id FROM ' . $db_config['prefix'] . '_' . $module_data . '_template where alias = "' . preg_replace("/[\\_]/", "-", $form) . '"')->fetchColumn();
if ($idtemplate) {
$array_tmp = array();
$result = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_field');
while ($row = $result->fetch()) {
$listtemplate = explode('|', $row['listtemplate']);
if (in_array($idtemplate, $listtemplate)) {
if (!$is_edit) {
if ($row['field_type'] == 'date') {
$array_custom[$row['field']] = $row['field_choices']['current_date'] ? NV_CURRENTTIME : $row['default_value'];
} elseif ($row['field_type'] == 'number') {
$array_custom[$row['field']] = $row['default_value'];
} else {
$temp = array_keys($row['field_choices']);
$tempkey = intval($row['default_value']) - 1;
$array_custom[$row['field']] = isset($temp[$tempkey]) ? $temp[$tempkey] : '';
}
} elseif (!empty($row['field_choices'])) {
$row['field_choices'] = unserialize($row['field_choices']);
} elseif (!empty($row['sql_choices'])) {
$row['sql_choices'] = explode('|', $row['sql_choices']);
$query = 'SELECT ' . $row['sql_choices'][2] . ', ' . $row['sql_choices'][3] . ' FROM ' . $row['sql_choices'][1];
$result_sql = $db->query($query);
$weight = 0;
while (list($key, $val) = $result_sql->fetch(3)) {
$row['field_choices'][$key] = $val;
}
}
if ($row['field_type'] == 'date') {
$array_custom[$row['field']] = empty($array_custom[$row['field']]) ? '' : date('d/m/Y', $array_custom[$row['field']]);
} elseif ($row['field_type'] == 'textarea') {
$array_custom[$row['field']] = nv_htmlspecialchars(nv_br2nl($array_custom[$row['field']]));
} elseif ($row['field_type'] == 'editor') {
$array_custom[$row['field']] = htmlspecialchars(nv_editor_br2nl($array_custom[$row['field']]));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$row['class'] = explode('@', $row['class']);
$edits = nv_aleditor('custom[' . $row['field'] . ']', $row['class'][0], $row['class'][1], $array_custom[$row['field']]);
$array_custom[$row['field']] = $edits;
} else {
$row['class'] = '';
}
} elseif ($row['field_type'] == 'select') {
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('OPTION', array('key' => $key, 'selected' => $key == $array_custom[$row['field']] ? ' selected="selected"' : '', 'title' => $value));
$xtpl->parse('main.select_' . $row['field']);
}
} elseif ($row['field_type'] == 'radio' or $row['field_type'] == 'checkbox') {
$number = 0;
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('OPTION', array('id' => $row['fid'] . '_' . $number++, 'key' => $key, 'checked' => $key == $array_custom[$row['field']] ? ' checked="checked"' : '', 'title' => $value));
$xtpl->parse('main.' . $row['field_type'] . '_' . $row['field']);
}
} elseif ($row['field_type'] == 'multiselect') {
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('OPTION', array('key' => $key, 'selected' => $key == $array_custom[$row['field']] ? ' selected="selected"' : '', 'title' => $value));
$xtpl->parse('main.' . $row['field']);
}
}
// Du lieu hien thi tieu de
$array_tmp[$row['field']] = unserialize($row['language']);
}
}
if (!empty($array_tmp)) {
foreach ($array_tmp as $f_key => $field) {
foreach ($field as $key_lang => $lang_data) {
if ($key_lang == NV_LANG_DATA) {
$array_custom_lang[$f_key] = array('title' => $lang_data[0], 'description' => isset($lang_data[1]) ? $lang_data[1] : '');
}
}
}
}
}
$xtpl->assign('ROW', $array_custom);
//.........这里部分代码省略.........
示例12: strlen
$sth->bindParam(':config_value', $bodytext, PDO::PARAM_STR, strlen($bodytext));
$sth->execute();
$nv_Cache->delMod('settings');
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
die;
}
$bodytext = isset($module_config[$module_name]['bodytext']) ? nv_editor_br2nl($module_config[$module_name]['bodytext']) : '';
$is_edit = $nv_Request->get_int('is_edit', 'get', 0);
if (empty($bodytext)) {
$is_edit = 1;
}
$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);
if ($is_edit) {
$bodytext = htmlspecialchars(nv_editor_br2nl($bodytext));
$xtpl->assign('FORM_ACTION', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$data = nv_aleditor('bodytext', '99%', '300px', $bodytext);
} else {
$data = "<textarea style=\"width: 99%\" name=\"bodytext\" id=\"bodytext\" cols=\"20\" rows=\"8\">" . $bodytext . "</textarea>";
}
$xtpl->assign('DATA', $data);
$xtpl->parse('main.edit');
} else {
$xtpl->assign('DATA', $bodytext);
$xtpl->assign('URL_EDIT', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&is_edit=1');
$xtpl->parse('main.data');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
示例13: nv_editor_filter_textarea
}
$page_title = $lang_module['content'];
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$content_file = NV_ROOTDIR . '/' . NV_DATADIR . '/' . NV_LANG_DATA . '_' . $module_data . 'Content.txt';
if ($nv_Request->get_int('save', 'post') == '1') {
$bodytext = nv_editor_filter_textarea('bodytext', '', NV_ALLOWED_HTML_TAGS, true);
file_put_contents($content_file, $bodytext);
Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
die;
}
$bodytext = "";
if (file_exists($content_file)) {
$bodytext = file_get_contents($content_file);
$bodytext = nv_editor_br2nl($bodytext);
}
$is_edit = $nv_Request->get_int('is_edit', 'get', 0);
if (empty($bodytext)) {
$is_edit = 1;
}
$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);
if ($is_edit) {
if (!empty($bodytext)) {
$bodytext = nv_htmlspecialchars($bodytext);
}
$xtpl->assign('FORM_ACTION', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$data = nv_aleditor("bodytext", '99%', '300px', $bodytext);
示例14: user_info
//.........这里部分代码省略.........
if ($userid == 0 and empty($custom_fields)) {
if (!empty($row['field_choices'])) {
if ($row['field_type'] == 'date') {
$row['value'] = $row['field_choices']['current_date'] ? NV_CURRENTTIME : $row['default_value'];
} elseif ($row['field_type'] == 'number') {
$row['value'] = $row['default_value'];
} else {
$temp = array_keys($row['field_choices']);
$tempkey = intval($row['default_value']) - 1;
$row['value'] = isset($temp[$tempkey]) ? $temp[$tempkey] : '';
}
} else {
$row['value'] = $row['default_value'];
}
} else {
$row['value'] = isset($custom_fields[$row['field']]) ? $custom_fields[$row['field']] : $row['default_value'];
}
$row['required'] = $row['required'] ? 'required' : '';
$xtpl->assign('FIELD', $row);
if ($row['required']) {
$xtpl->parse('main.tab_edit_others.loop.required');
}
if ($row['field_type'] == 'textbox' or $row['field_type'] == 'number') {
$xtpl->parse('main.tab_edit_others.loop.textbox');
} elseif ($row['field_type'] == 'date') {
$row['value'] = empty($row['value']) ? '' : date('d/m/Y', $row['value']);
$xtpl->assign('FIELD', $row);
$xtpl->parse('main.tab_edit_others.loop.date');
} elseif ($row['field_type'] == 'textarea') {
$row['value'] = nv_htmlspecialchars(nv_br2nl($row['value']));
$xtpl->assign('FIELD', $row);
$xtpl->parse('main.tab_edit_others.loop.textarea');
} elseif ($row['field_type'] == 'editor') {
$row['value'] = htmlspecialchars(nv_editor_br2nl($row['value']));
if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
$array_tmp = explode('@', $row['class']);
$edits = nv_aleditor('custom_fields[' . $row['field'] . ']', $array_tmp[0], $array_tmp[1], $row['value'], 'Basic');
$xtpl->assign('EDITOR', $edits);
$xtpl->parse('main.tab_edit_others.loop.editor');
} else {
$row['class'] = '';
$xtpl->assign('FIELD', $row);
$xtpl->parse('main.tab_edit_others.loop.textarea');
}
} elseif ($row['field_type'] == 'select') {
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('FIELD_CHOICES', array('key' => $key, 'selected' => $key == $row['value'] ? ' selected="selected"' : '', 'value' => $value));
$xtpl->parse('main.tab_edit_others.loop.select.loop');
}
$xtpl->parse('main.tab_edit_others.loop.select');
} elseif ($row['field_type'] == 'radio') {
$number = 0;
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('FIELD_CHOICES', array('id' => $row['fid'] . '_' . $number++, 'key' => $key, 'checked' => $key == $row['value'] ? ' checked="checked"' : '', 'value' => $value));
$xtpl->parse('main.tab_edit_others.loop.radio.loop');
}
$xtpl->parse('main.tab_edit_others.loop.radio');
} elseif ($row['field_type'] == 'checkbox') {
$number = 0;
$valuecheckbox = !empty($row['value']) ? explode(',', $row['value']) : array();
foreach ($row['field_choices'] as $key => $value) {
$xtpl->assign('FIELD_CHOICES', array('id' => $row['fid'] . '_' . $number++, 'key' => $key, 'checked' => in_array($key, $valuecheckbox) ? ' checked="checked"' : '', 'value' => $value));
$xtpl->parse('main.tab_edit_others.loop.checkbox.loop');
}
$xtpl->parse('main.tab_edit_others.loop.checkbox');
} elseif ($row['field_type'] == 'multiselect') {
示例15: defined
$value .= $row_bpn['width'] . "x" . $row_bpn['height'] . "px";
$value .= ")";
$sel = $row['xbanner'] == $row_bpn['id'] ? ' selected' : '';
$contents .= "<option value=\"" . $row_bpn['id'] . "\" " . $sel . ">" . $value . "</option>\n";
}
$contents .= "</select></td>\n";
$contents .= "</tr>\n";
$contents .= "</tbody>\n";
$showstype = $row['type'] == 'html' ? "" : " style='display:none' ";
$contents .= "<tbody " . $showstype . " id='html'>\n";
$contents .= "<tr>\n";
$contents .= "<td colspan='2'>" . $lang_module['block_content'] . ":<br />\n";
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$row['xhtml'] = defined('NV_EDITOR') ? nv_editor_br2nl($row['xhtml']) : nv_br2nl($row['xhtml']);
$row['xhtml'] = nv_htmlspecialchars($row['xhtml']);
if (defined('NV_EDITOR') and function_exists('nv_aleditor')) {
$contents .= nv_aleditor("htmlcontent", '700px', '150px', $row['xhtml']);
} else {
$contents .= "<textarea style=\"width: 700px\" name=\"htmlcontent\" id=\"htmlcontent\" cols=\"20\" rows=\"8\">" . $row['xhtml'] . "</textarea>";
}
$contents .= "</td>\n";
$contents .= "</tr>\n";
$contents .= "</tbody>\n";
$showstype = $row['type'] == 'rss' ? "" : " style='display:none' ";
$contents .= "<tbody " . $showstype . " id='rss'>\n";
$contents .= "<tr>\n";
$contents .= "<td>" . $lang_module['block_rss_url'] . ":</td>\n";
$contents .= "<td><input name=\"xrss\" type=\"text\" value=\"" . $row['xrss'] . "\" style=\"width:500px\"/></td>\n";
$contents .= "</tr>\n";