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


PHP nv_nl2br函数代码示例

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


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

示例1: nv_block_data_config_html_submit

 function nv_block_data_config_html_submit($module, $lang_block)
 {
     $xhtml = filter_text_textarea('htmlcontent', '', NV_ALLOWED_HTML_TAGS);
     $return = array();
     $return['error'] = array();
     $return['config'] = array();
     $return['config']['htmlcontent'] = defined('NV_EDITOR') ? nv_editor_nl2br($xhtml) : nv_nl2br($xhtml, '<br />');
     return $return;
 }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:9,代码来源:global.html.php

示例2: BoldKeywordInStr

/**
 * BoldKeywordInStr()
 * 
 * @param mixed $str
 * @param mixed $keyword
 * @return
 */
function BoldKeywordInStr($str, $keyword, $logic)
{
    global $db;
    $str = nv_br2nl($str);
    $str = nv_nl2br($str, " ");
    $str = nv_unhtmlspecialchars(strip_tags(trim($str)));
    $str = $db->unfixdb($str);
    $pos = false;
    if ($logic == 'AND') {
        $array_keyword = array($keyword, nv_EncString($keyword));
    } else {
        $keyword .= " " . nv_EncString($keyword);
        $array_keyword = explode(" ", $keyword);
        $array_keyword = array_unique($array_keyword);
    }
    foreach ($array_keyword as $k) {
        unset($matches);
        if (preg_match("/^(.*?)" . preg_quote($k) . "/uis", $str, $matches)) {
            $strlen = nv_strlen($str);
            $kstrlen = nv_strlen($k);
            $residual = $strlen - 300;
            if ($residual > 0) {
                $lstrlen = nv_strlen($matches[1]);
                $rstrlen = $strlen - $lstrlen - $kstrlen;
                $medium = round((300 - $kstrlen) / 2);
                if ($lstrlen <= $medium) {
                    $str = nv_clean60($str, 300);
                } elseif ($rstrlen <= $medium) {
                    $str = nv_substr($str, $residual, 300);
                    $str = nv_substr_clean($str, 'l');
                } else {
                    $str = nv_substr($str, $lstrlen - $medium, $strlen - $lstrlen + $medium);
                    $str = nv_substr($str, 0, 300);
                    $str = nv_substr_clean($str, 'lr');
                }
            }
            $pos = true;
            break;
        }
    }
    if (!$pos) {
        return nv_clean60($str, 300);
    }
    $pattern = array();
    foreach ($array_keyword as $k) {
        $pattern[] = "/(" . preg_quote($k) . ")/uis";
    }
    $str = preg_replace($pattern, "{\\1}", $str);
    $str = str_replace(array("{", "}"), array("<span class=\"keyword\">", "</span>"), $str);
    return $str;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:58,代码来源:functions.php

示例3: BoldKeywordInStr

/**
 * BoldKeywordInStr()
 *
 * @param mixed $str
 * @param mixed $keyword
 * @return
 */
function BoldKeywordInStr($str, $keyword, $logic)
{
    $str = nv_br2nl($str);
    $str = nv_nl2br($str, ' ');
    $str = nv_unhtmlspecialchars(strip_tags(trim($str)));
    $pos = false;
    if ($logic == 'AND') {
        $array_keyword = array($keyword, nv_EncString($keyword));
    } else {
        $keyword .= ' ' . nv_EncString($keyword);
        $array_keyword = explode(' ', $keyword);
        $array_keyword = array_unique($array_keyword);
    }
    foreach ($array_keyword as $k) {
        if (preg_match('/^(.*?)' . nv_preg_quote($k) . '/uis', $str, $matches)) {
            $strlen = nv_strlen($str);
            $kstrlen = nv_strlen($k);
            $residual = $strlen - 300;
            if ($residual > 0) {
                $lstrlen = nv_strlen($matches[1]);
                $rstrlen = $strlen - $lstrlen - $kstrlen;
                $medium = round((300 - $kstrlen) / 2);
                if ($lstrlen <= $medium) {
                    $str = nv_clean60($str, 300);
                } elseif ($rstrlen <= $medium) {
                    $str = nv_substr($str, $residual, 300);
                    $str = nv_substr_clean($str, 'l');
                } else {
                    $str = nv_substr($str, $lstrlen - $medium, $strlen - $lstrlen + $medium);
                    $str = nv_substr($str, 0, 300);
                    $str = nv_substr_clean($str, 'lr');
                }
            }
            $pos = true;
            break;
        }
    }
    if (!$pos) {
        return nv_clean60($str, 300);
    }
    $pattern = array();
    foreach ($array_keyword as $k) {
        $pattern[] = '/(' . nv_preg_quote($k) . ')/uis';
    }
    $str = preg_replace($pattern, '{\\1}', $str);
    $str = str_replace(array('{', '}'), array('<span class="keyword">', '</span>'), $str);
    return $str;
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:55,代码来源:functions.php

示例4: nv_write_lang_mod_admin

function nv_write_lang_mod_admin($mod, $lang, $arr_new_lang)
{
    global $funname;
    if (!empty($arr_new_lang)) {
        if (file_exists(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php')) {
            $content_lang = file_get_contents(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php');
            $content_lang = trim($content_lang);
            $content_lang = rtrim($content_lang, '?>');
        } else {
            $content_lang = "<?php\n\n";
            $content_lang .= "/**\n";
            $content_lang .= "* @Project NUKEVIET 4.x\n";
            $content_lang .= "* @Author VINADES.,JSC (contact@vinades.vn)\n";
            $content_lang .= "* @Copyright (C) " . date("Y") . " VINADES.,JSC. All rights reserved\n";
            $content_lang .= "* @Language " . $language_array[$dirlang]['name'] . "\n";
            $content_lang .= "* @License CC BY-SA (http://creativecommons.org/licenses/by-sa/4.0/)\n";
            $content_lang .= "* @Createdate " . gmdate("M d, Y, h:i:s A", time()) . "\n";
            $content_lang .= "*/\n";
            $content_lang .= "\nif( ! defined( 'NV_ADMIN' ) or ! defined( 'NV_MAINFILE' ) )";
            $content_lang .= " die( 'Stop!!!' );\n\n";
            $array_translator['info'] = isset($array_translator['info']) ? $array_translator['info'] : "";
            $content_lang .= "\$lang_translator['author'] = 'VINADES.,JSC (contact@vinades.vn)';\n";
            $content_lang .= "\$lang_translator['createdate'] = '" . date('d/m/Y, H:i') . "';\n";
            $content_lang .= "\$lang_translator['copyright'] = 'Copyright (C) ' . date( 'Y' ) . ' VINADES.,JSC. All rights reserved';\n";
            $content_lang .= "\$lang_translator['info'] = '';\n";
            $content_lang .= "\$lang_translator['langtype'] = 'lang_module';\n";
            $content_lang .= "\n";
        }
        $content_lang .= "\n\n//Lang for function " . $funname . "\n";
        foreach ($arr_new_lang as $lang_key => $lang_value) {
            $lang_value = nv_unhtmlspecialchars($lang_value);
            $lang_value = str_replace("\\'", "'", $lang_value);
            $lang_value = str_replace("'", "\\'", $lang_value);
            $lang_value = nv_nl2br($lang_value);
            $lang_value = str_replace('<br />', '<br />', $lang_value);
            $content_lang .= "\$lang_module['" . $lang_key . "'] = '" . $lang_value . "';\n";
        }
        if (!is_writable(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php')) {
            if (substr($sys_info['os'], 0, 3) != 'WIN') {
                chmod(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php', 0777);
            }
        }
        file_put_contents(NV_ROOTDIR . '/modules/' . $mod . '/language/admin_' . $lang . '.php', $content_lang, LOCK_EX);
    }
}
开发者ID:hpleduit,项目名称:module-nvtools,代码行数:45,代码来源:addfun.php

示例5: filter_text_input

 $fcode = filter_text_input('fcode', 'post', '');
 $check_valid_email = nv_check_valid_email($femail);
 if (empty($fname)) {
     $error = $lang_module['error_fullname'];
 } elseif (!empty($check_valid_email)) {
     $error = $check_valid_email;
 } elseif (empty($ftitle)) {
     $error = $lang_module['error_title'];
 } elseif (empty($fcon)) {
     $error = $lang_module['error_content'];
 } elseif (!isset($array_rows[$fpart])) {
     $error = $lang_module['error_part'];
 } elseif (!nv_capcha_txt($fcode)) {
     $error = $lang_module['error_captcha'];
 } else {
     $fcon = nv_nl2br($fcon);
     $sender_id = intval(defined('NV_IS_USER') ? $user_info['userid'] : 0);
     $sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_send` VALUES \n            (NULL , " . $fpart . ", " . $db->dbescape($ftitle) . ", " . $db->dbescape($fcon) . ", \n            " . NV_CURRENTTIME . ", " . $sender_id . ", " . $db->dbescape($fname) . ", " . $db->dbescape($femail) . ", \n            " . $db->dbescape($fphone) . ", " . $db->dbescape($client_info['ip']) . ", 0, 0, '', 0, 0);";
     $db->sql_query($sql);
     $website = "<a href=\"" . $global_config['site_url'] . "\">" . $global_config['site_name'] . "</a>";
     $fcon .= "<br /><br />----------------------------------------<br /><br />";
     if (empty($fphone)) {
         $fcon .= sprintf($lang_module['sendinfo'], $website, $fname, $femail, $client_info['ip'], $array_rows[$fpart]['full_name']);
     } else {
         $fcon .= sprintf($lang_module['sendinfo2'], $website, $fname, $femail, $fphone, $client_info['ip'], $array_rows[$fpart]['full_name']);
     }
     nv_SendMail2User($fpart, $fcon, $ftitle, $femail, $fname);
     $url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA;
     $contents .= call_user_func("sendcontact", $url);
     include NV_ROOTDIR . "/includes/header.php";
     echo nv_site_theme($contents);
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:main.php

示例6: nv_admin_read_lang


//.........这里部分代码省略.........
            $lang_translator_save = array();
            $lang_translator_save['author'] = isset($lang_translator['author']) ? strip_tags($lang_translator['author']) : 'VINADES.,JSC (contact@vinades.vn)';
            $lang_translator_save['createdate'] = isset($lang_translator['createdate']) ? strip_tags($lang_translator['createdate']) : date('d/m/Y, H:i');
            $lang_translator_save['copyright'] = isset($lang_translator['copyright']) ? strip_tags($lang_translator['copyright']) : 'Copyright (C) ' . date('Y') . ' VINADES.,JSC. All rights reserved';
            $lang_translator_save['info'] = isset($lang_translator['info']) ? strip_tags($lang_translator['info']) : '';
            $lang_translator_save['langtype'] = $langtype;
            $author = var_export($lang_translator_save, true);
            $data = array();
            $data['module'] = $module;
            $data['admin_file'] = $admin_file;
            $data['langtype'] = $langtype;
            $data['author'] = $author;
            $idfile = $db->insert_id('INSERT INTO ' . NV_LANGUAGE_GLOBALTABLE . '_file (module, admin_file, langtype, author_' . $dirlang . ') VALUES (:module, :admin_file, :langtype, :author)', 'idfile', $data);
            if (empty($idfile)) {
                nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], 'error read file: ' . str_replace(NV_ROOTDIR . '/', '', $include_lang));
            }
        } else {
            $lang_translator_save = array();
            $langtype = isset($lang_translator['langtype']) ? strip_tags($lang_translator['langtype']) : 'lang_module';
            $lang_translator_save['author'] = isset($lang_translator['author']) ? strip_tags($lang_translator['author']) : 'VINADES.,JSC (contact@vinades.vn)';
            $lang_translator_save['createdate'] = isset($lang_translator['createdate']) ? strip_tags($lang_translator['createdate']) : date('d/m/Y, H:i');
            $lang_translator_save['copyright'] = isset($lang_translator['copyright']) ? strip_tags($lang_translator['copyright']) : 'Copyright (C) ' . date('Y') . ' VINADES.,JSC. All rights reserved';
            $lang_translator_save['info'] = isset($lang_translator['info']) ? strip_tags($lang_translator['info']) : '';
            $lang_translator_save['langtype'] = $langtype;
            $author = var_export($lang_translator_save, true);
            try {
                $sth = $db->prepare('UPDATE ' . NV_LANGUAGE_GLOBALTABLE . '_file SET author_' . $dirlang . '= :author WHERE idfile= ' . $idfile);
                $sth->bindParam(':author', $author, PDO::PARAM_STR, strlen($author));
                $sth->execute();
            } catch (PDOException $e) {
                nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $e->getMessage());
            }
        }
        $temp_lang = array();
        switch ($langtype) {
            case 'lang_global':
                $temp_lang = $lang_global;
                break;
            case 'lang_module':
                $temp_lang = $lang_module;
                break;
            case 'lang_block':
                $temp_lang = $lang_block;
                break;
        }
        $add_field = true;
        $array_lang_key = array();
        $array_lang_value = array();
        $columns_array = $db->columns_array(NV_LANGUAGE_GLOBALTABLE . '_file');
        foreach ($columns_array as $row) {
            if (substr($row['field'], 0, 7) == 'author_' and $row['field'] != 'author_' . $dirlang) {
                $array_lang_key[] = str_replace('author_', 'lang_', $row['field']);
                $array_lang_value[] = '';
            }
        }
        $string_lang_key = implode(', ', $array_lang_key);
        $string_lang_value = '';
        if ($string_lang_key != '') {
            $string_lang_key = ', ' . $string_lang_key;
            $string_lang_value = implode("', '", $array_lang_value);
            $string_lang_value = ", '" . $string_lang_value . "'";
        }
        $read_type = intval($global_config['read_type']);
        $sth_is = $db->prepare('INSERT INTO ' . NV_LANGUAGE_GLOBALTABLE . ' (idfile, lang_key, lang_' . $dirlang . ', update_' . $dirlang . ') VALUES (:idfile, :lang_key, :lang_value, ' . NV_CURRENTTIME . ')');
        $sth_ud = $db->prepare('UPDATE ' . NV_LANGUAGE_GLOBALTABLE . ' SET lang_' . $dirlang . ' = :lang_value, update_' . $dirlang . ' = ' . NV_CURRENTTIME . ' WHERE idfile = :idfile AND lang_key = :lang_key');
        while (list($lang_key, $lang_value) = each($temp_lang)) {
            $check_type_update = false;
            $lang_key = trim($lang_key);
            $lang_value = nv_nl2br($lang_value);
            $lang_value = preg_replace("/<br\\s*\\/>/", '<br />', $lang_value);
            $lang_value = preg_replace("/<\\/\\s*br\\s*>/", '<br />', $lang_value);
            if ($read_type == 0 or $read_type == 1) {
                try {
                    $sth_is->bindParam(':idfile', $idfile, PDO::PARAM_INT);
                    $sth_is->bindParam(':lang_key', $lang_key, PDO::PARAM_STR);
                    $sth_is->bindParam(':lang_value', $lang_value, PDO::PARAM_STR);
                    $sth_is->execute();
                    if ($read_type == 0 and !$sth_is->rowCount()) {
                        $check_type_update = true;
                    }
                } catch (PDOException $e) {
                    if ($read_type == 0) {
                        $check_type_update = true;
                    }
                }
            }
            if ($read_type == 2 or $check_type_update) {
                $sth_ud->bindParam(':idfile', $idfile, PDO::PARAM_INT);
                $sth_ud->bindParam(':lang_key', $lang_key, PDO::PARAM_STR);
                $sth_ud->bindParam(':lang_value', $lang_value, PDO::PARAM_STR);
                $sth_ud->execute();
            }
        }
        $lang_module = $lang_module_temp;
        return '';
    } else {
        $include_lang = '';
        return $lang_module['nv_error_exit_module'] . ' : ' . $module;
    }
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:101,代码来源:read.php

示例7: nv_del_moduleCache

         $db->sql_freeresult();
         nv_del_moduleCache($module_name);
         Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op . "");
         die;
     } else {
         $error = $lang_module['errorsave'];
     }
 } elseif ($catid > 0 and !empty($title)) {
     $check_exit = 0;
     if ($parentid != $parentid_old) {
         list($check_exit) = $db->sql_fetchrow($db->sql_query("SELECT count(*) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `catid` = '" . $catid . "'"));
     }
     if (intval($check_exit) > 0) {
         $error = "error delete cat";
     } else {
         $description = nv_nl2br($description, '<br />');
         //
         $query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_cat` SET `parentid`=" . $db->dbescape($parentid) . ", `title`=" . $db->dbescape($title) . ", `catimage` =  " . $db->dbescape($catimage) . ", `alias` =  " . $db->dbescape($alias) . ", `description`=" . $db->dbescape($description) . ", `keywords`= " . $db->dbescape($keywords) . ", `edit_time`=UNIX_TIMESTAMP( ) WHERE `catid` =" . $catid . "";
         $db->sql_query($query);
         if ($db->sql_affectedrows() > 0) {
             $db->sql_freeresult();
             if ($parentid != $parentid_old) {
                 list($weight) = $db->sql_fetchrow($db->sql_query("SELECT max(`weight`) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_cat` WHERE `parentid`=" . $db->dbescape($parentid) . ""));
                 $weight = intval($weight) + 1;
                 $sql = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_cat` SET `weight`=" . $weight . " WHERE `catid`=" . intval($catid);
                 $db->sql_query($sql);
                 nv_fix_cat($parentid);
                 nv_fix_cat($parentid_old);
                 nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_cat', "catid " . $catid, $admin_info['userid']);
             }
             nv_del_moduleCache($module_name);
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:cat.php

示例8: change_alias

 * begin: post data 
 */
if ($nv_Request->get_int('save', 'post') == 1) {
    $data['catid'] = $nv_Request->get_int('catid', 'post', 0);
    $data['roomid'] = $nv_Request->get_int('roomid', 'post', 0);
    $data['fieldid'] = $nv_Request->get_int('fieldid', 'post', 0);
    $data['type'] = $nv_Request->get_int('type', 'post', 0);
    $data['title'] = $nv_Request->get_string('title', 'post', '', 0);
    $data['keywords'] = $nv_Request->get_string('keywords', 'post', '', 1);
    $alias = $nv_Request->get_string('alias', 'post', '');
    $data['alias'] = $alias == "" ? change_alias($data['title']) : change_alias($alias);
    $hometext = $nv_Request->get_string('hometext', 'post', '');
    $data['hometext'] = nv_nl2br(nv_htmlspecialchars(strip_tags($hometext)), '<br />');
    $data['otherpath'] = $nv_Request->get_string('otherpath', 'post', '');
    $bodytext = $nv_Request->get_string('bodytext', 'post', '');
    $data['bodytext'] = defined('NV_EDITOR') ? nv_nl2br($bodytext, '') : nv_nl2br(nv_htmlspecialchars(strip_tags($bodytext)), '<br />');
    $data['sign'] = $nv_Request->get_string('sign', 'post', '');
    $signtime = $nv_Request->get_string('signtime', 'post', 0);
    $data['organid'] = $nv_Request->get_int('organid', 'post', 0);
    if (!empty($signtime) and !preg_match("/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})\$/", $signtime)) {
        $signtime = "";
    }
    if (empty($signtime)) {
        $data['signtime'] = 0;
    } else {
        $phour = date('H');
        $pmin = date('i');
        unset($m);
        preg_match("/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})\$/", $signtime, $m);
        $data['signtime'] = mktime($phour, $pmin, 0, $m[2], $m[1], $m[3]);
    }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:31,代码来源:content.php

示例9: elseif

     $error = $lang_module['edit_error_email_exist'];
 } elseif (!empty($_user['password1']) and ($check_pass = nv_check_valid_pass($_user['password1'], NV_UPASSMAX, NV_UPASSMIN)) != '') {
     $error = $check_pass;
 } elseif (!empty($_user['password1']) and $_user['password1'] != $_user['password2']) {
     $error = $lang_module['edit_error_password'];
 } elseif (empty($_user['question'])) {
     $error = $lang_module['edit_error_question'];
 } elseif (empty($_user['answer'])) {
     $error = $lang_module['edit_error_answer'];
 } else {
     $query_field = array();
     if (!empty($array_field_config)) {
         require NV_ROOTDIR . '/modules/users/fields.check.php';
     }
     if (empty($error)) {
         $_user['sig'] = nv_nl2br($_user['sig'], '<br />');
         if ($_user['gender'] != 'M' and $_user['gender'] != 'F') {
             $_user['gender'] = '';
         }
         if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $_user['birthday'], $m)) {
             $_user['birthday'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
         } else {
             $_user['birthday'] = 0;
         }
         $password = !empty($_user['password1']) ? $crypt->hash_password($_user['password1'], $global_config['hashprefix']) : $row['password'];
         // Check photo
         if ($_user['delpic'] or empty($photo)) {
             if (!empty($_user['photo'])) {
                 $tmp_photo = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $_user['photo'];
                 if (!file_exists($tmp_photo)) {
                     $_user['photo'] = '';
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:edit.php

示例10: elseif

 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
     $error = $lang_module['edit_error_email_exist'];
 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
     $error = $lang_module['edit_error_email_exist'];
 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
     $error = $lang_module['edit_error_email_exist'];
 } elseif (($check_pass = nv_check_valid_pass($_user['password1'], NV_UPASSMAX, NV_UPASSMIN)) != "") {
     $error = $check_pass;
 } elseif ($_user['password1'] != $_user['password2']) {
     $error = $lang_module['edit_error_password'];
 } elseif (empty($_user['question'])) {
     $error = $lang_module['edit_error_question'];
 } elseif (empty($_user['answer'])) {
     $error = $lang_module['edit_error_answer'];
 } else {
     $_user['sig'] = nv_nl2br($_user['sig'], "<br />");
     if ($_user['gender'] != "M" and $_user['gender'] != "F") {
         $_user['gender'] = "";
     }
     if (preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $_user['birthday'], $m)) {
         $_user['birthday'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
     } else {
         $_user['birthday'] = 0;
     }
     $data_in_groups = !empty($_user['in_groups']) ? implode(',', $_user['in_groups']) : '';
     $password = $crypt->hash($_user['password1']);
     $sql = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "` (\n        `userid`, `username`, `md5username`, `password`, `email`, `full_name`, `gender`, `birthday`, `sig`, `regdate`, \n        `website`, `location`, `yim`, `telephone`, `fax`, `mobile`, `question`, `answer`, `passlostkey`, `view_mail`, \n        `remember`, `in_groups`, `active`, `checknum`, `last_login`, `last_ip`, `last_agent`, `last_openid`) \n        VALUES(\n\t\tNULL, \n\t\t" . $db->dbescape($_user['username']) . ",\n\t\t" . $db->dbescape(md5($_user['username'])) . ",\n\t\t" . $db->dbescape($password) . ",\n\t\t" . $db->dbescape($_user['email']) . ",\n\t\t" . $db->dbescape($_user['full_name']) . ",\n\t\t" . $db->dbescape($_user['gender']) . ",\n\t\t" . $_user['birthday'] . ",\n\t\t" . $db->dbescape($_user['sig']) . ",\n\t\t" . NV_CURRENTTIME . ",\n\t\t" . $db->dbescape($_user['website']) . ",\n\t\t" . $db->dbescape($_user['location']) . ",\n\t\t" . $db->dbescape($_user['yim']) . ",\n\t\t" . $db->dbescape($_user['telephone']) . ",\n\t\t" . $db->dbescape($_user['fax']) . ",\n\t\t" . $db->dbescape($_user['mobile']) . ",\n\t\t" . $db->dbescape($_user['question']) . ",\n\t\t" . $db->dbescape($_user['answer']) . ",\n\t\t'', \n        " . $_user['view_mail'] . ", \n        1, \n        " . $db->dbescape_string($data_in_groups) . ", \n        1, '', 0, '', '', '')";
     $userid = $db->sql_query_insert_id($sql);
     if ($userid) {
         nv_insert_logs(NV_LANG_DATA, $module_name, 'log_add_user', "userid " . $userid, $admin_info['userid']);
         if (isset($_FILES['photo']) and is_uploaded_file($_FILES['photo']['tmp_name'])) {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:user_add.php

示例11: elseif

     $is_error = true;
     $error = $lang_module['file_error_title'];
 } elseif ($is_exists) {
     $is_error = true;
     $error = $lang_module['file_title_exists'];
 } elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != '') {
     $is_error = true;
     $error = $check_valid_email;
 } elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
     $is_error = true;
     $error = $lang_module['file_error_author_url'];
 } elseif (empty($array['fileupload']) and empty($array['linkdirect'])) {
     $is_error = true;
     $error = $lang_module['file_error_fileupload'];
 } else {
     $array['introtext'] = !empty($array['introtext']) ? nv_nl2br($array['introtext'], '<br />') : '';
     $array['fileupload'] = !empty($array['fileupload']) ? implode('[NV]', $array['fileupload']) : '';
     if (!empty($array['linkdirect'])) {
         $array['linkdirect'] = array_map('nv_nl2br', $array['linkdirect']);
         $array['linkdirect'] = implode('[NV]', $array['linkdirect']);
     } else {
         $array['linkdirect'] = '';
     }
     $sql = "INSERT INTO " . NV_PREFIXLANG . "_" . $module_data . " (catid, title, alias, description, introtext, uploadtime, updatetime, user_id, user_name, author_name, author_email, author_url, fileupload, linkdirect, version, filesize, fileimage, status, copyright, view_hits, download_hits, groups_comment, groups_view, groups_download, comment_hits, rating_detail) VALUES (\n\t\t\t " . $array['catid'] . ",\n\t\t\t :title,\n\t\t\t :alias ,\n\t\t\t :description ,\n\t\t\t :introtext ,\n\t\t\t " . NV_CURRENTTIME . ",\n\t\t\t " . NV_CURRENTTIME . ",\n\t\t\t " . $admin_info['admin_id'] . ",\n\t\t\t :username,\n\t\t\t :author_name ,\n\t\t\t :author_email ,\n\t\t\t :author_url ,\n\t\t\t :fileupload ,\n\t\t\t :linkdirect ,\n\t\t\t :version ,\n\t\t\t " . $array['filesize'] . ",\n\t\t\t :fileimage ,\n\t\t\t 1,\n\t\t\t :copyright ,\n\t\t\t 0, 0,\n\t\t\t :groups_comment ,\n\t\t\t :groups_view ,\n\t\t\t :groups_download ,\n\t\t\t 0, '')";
     $data_insert = array();
     $data_insert['title'] = $array['title'];
     $data_insert['alias'] = $array['alias'];
     $data_insert['description'] = $array['description'];
     $data_insert['introtext'] = $array['introtext'];
     $data_insert['username'] = $admin_info['username'];
     $data_insert['author_name'] = $array['author_name'];
开发者ID:NukeVlad,项目名称:module-download,代码行数:31,代码来源:add.php

示例12: array

 $array = array();
 $is_error = false;
 $error = "";
 if ($nv_Request->isset_request('submit', 'post')) {
     $array['subject'] = filter_text_input('subject', 'post', '', 1);
     $array['comment'] = filter_text_textarea('comment', '', NV_ALLOWED_HTML_TAGS);
     $array['admin_reply'] = filter_text_input('admin_reply', 'post', '', 1);
     $array['admin_id'] = (int) $row['admin_id'];
     if (empty($array['subject'])) {
         $is_error = true;
         $error = $lang_module['comment_edit_error1'];
     } elseif (empty($array['comment'])) {
         $is_error = true;
         $error = $lang_module['comment_edit_error2'];
     } else {
         $array['comment'] = nv_nl2br($array['comment'], "<br />");
         if (!empty($array['admin_reply']) and $array['admin_reply'] != $row['admin_reply']) {
             $array['admin_id'] = $admin_info['admin_id'];
         }
         $sql = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_comments` SET \n            `subject`=" . $db->dbescape($array['subject']) . ", \n            `comment`=" . $db->dbescape($array['comment']) . ", \n            `admin_reply`=" . $db->dbescape($array['admin_reply']) . ", \n            `admin_id`=" . $array['admin_id'] . " \n            WHERE `id`=" . $id;
         $result = $db->sql_query($sql);
         if (!$result) {
             $is_error = true;
             $error = $lang_module['file_error1'];
         } else {
             nv_del_moduleCache($module_name);
             Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=comment&status=" . $row['status']);
             exit;
         }
     }
 } else {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:comment.php

示例13: die

    }
    $url = $nv_Request->get_string('url', 'post', '');
    $is_myurl = $nv_Request->get_int('is_myurl', 'post', 0);
    if (empty($url)) {
        die($lang_module['file_checkUrl_error']);
    }
    $url = rawurldecode($url);
    if ($is_myurl) {
        $url = substr($url, strlen(NV_BASE_SITEURL));
        $url = NV_ROOTDIR . '/' . $url;
        if (!file_exists($url)) {
            die($lang_module['file_checkUrl_error']);
        }
    } else {
        $url = trim($url);
        $url = nv_nl2br($url, "<br />");
        $url = explode("<br />", $url);
        $url = array_map("trim", $url);
        foreach ($url as $l) {
            if (!empty($l)) {
                if (!nv_is_url($l)) {
                    die($lang_module['file_checkUrl_error']);
                }
                if (!nv_check_url($l)) {
                    die($lang_module['file_checkUrl_error']);
                }
            }
        }
    }
    die($lang_module['file_checkUrl_ok']);
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:admin.functions.php

示例14: array

if ($submit) {
    $array_config = array();
    $array_config['site_theme'] = filter_text_input('site_theme', 'post', '', 1, 255);
    $array_config['site_name'] = filter_text_input('site_name', 'post', '', 1, 255);
    $array_config['site_logo'] = filter_text_input('site_logo', 'post', '', 1, 255);
    if (!in_array($array_config['site_logo'], $images)) {
        $array_config['site_logo'] = "logo.png";
    }
    $array_config['site_home_module'] = filter_text_input('site_home_module', 'post', '', 1, 255);
    $array_config['site_description'] = filter_text_input('site_description', 'post', '', 1, 255);
    $array_config['disable_site'] = $nv_Request->get_int('disable_site', 'post');
    $array_config['disable_site_content'] = filter_text_textarea('disable_site_content', '', NV_ALLOWED_HTML_TAGS);
    if (empty($array_config['disable_site_content'])) {
        $array_config['disable_site_content'] = $lang_global['disable_site_content'];
    }
    $array_config['disable_site_content'] = nv_nl2br($array_config['disable_site_content'], '<br />');
    // dung de save vao csdl
    foreach ($array_config as $config_name => $config_value) {
        $db->sql_query("UPDATE `" . NV_CONFIG_GLOBALTABLE . "` \r\n        SET `config_value`=" . $db->dbescape($config_value) . " \r\n        WHERE `config_name` = " . $db->dbescape($config_name) . " \r\n        AND `lang` = '" . NV_LANG_DATA . "' AND `module`='global' \r\n        LIMIT 1");
    }
    if ($array_config['site_theme'] != $global_config['site_theme']) {
        $global_config['site_theme'] = $array_config['site_theme'];
        nv_set_layout_site();
    }
    nv_save_file_config_global();
    if (empty($errormess)) {
        Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&rand=' . nv_genpass());
        exit;
    } else {
        $sql = $db->constructQuery("SELECT `module`, `config_name`, `config_value` FROM `" . NV_CONFIG_GLOBALTABLE . "` \r\n        WHERE `lang`=[s] OR `lang`=[s] ORDER BY `module` ASC", 'sys', NV_LANG_DATA);
        $result = $db->sql_query($sql);
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:main.php

示例15: nv_admin_read_lang


//.........这里部分代码省略.........
        $include_lang = NV_ROOTDIR . "/language/" . $dirlang . "/" . $module . ".php";
    } elseif ($module == "install" and $admin_file == 0) {
        $include_lang = NV_ROOTDIR . "/language/" . $dirlang . "/" . $module . ".php";
    } elseif (in_array($module, $modules_exit) and $admin_file == 1) {
        $include_lang = NV_ROOTDIR . "/modules/" . $module . "/language/admin_" . $dirlang . ".php";
    } elseif (in_array($module, $modules_exit) and $admin_file == 0) {
        $include_lang = NV_ROOTDIR . "/modules/" . $module . "/language/" . $dirlang . ".php";
    } elseif (file_exists(NV_ROOTDIR . "/language/" . $dirlang . "/admin_" . $module . ".php")) {
        $admin_file = 1;
        $include_lang = NV_ROOTDIR . "/language/" . $dirlang . "/admin_" . $module . ".php";
    }
    if ($include_lang != "" and file_exists($include_lang)) {
        $lang_module_temp = $lang_module;
        $lang_module = array();
        $lang_global = array();
        $lang_block = array();
        $lang_translator = array();
        include $include_lang;
        list($idfile, $langtype) = $db->sql_fetchrow($db->sql_query("SELECT idfile, langtype FROM `" . NV_LANGUAGE_GLOBALTABLE . "_file` WHERE `module` =" . $db->dbescape($module) . " AND `admin_file`=" . $db->dbescape($admin_file)));
        if (intval($idfile) == 0) {
            $langtype = isset($lang_translator['langtype']) ? strip_tags($lang_translator['langtype']) : "lang_module";
            $lang_translator_save = array();
            $lang_translator_save['author'] = isset($lang_translator['author']) ? strip_tags($lang_translator['author']) : "VINADES.,JSC (contact@vinades.vn)";
            $lang_translator_save['createdate'] = isset($lang_translator['createdate']) ? strip_tags($lang_translator['createdate']) : date("d/m/Y, H:i");
            $lang_translator_save['copyright'] = isset($lang_translator['copyright']) ? strip_tags($lang_translator['copyright']) : "Copyright (C) 2010 VINADES.,JSC. All rights reserved";
            $lang_translator_save['info'] = isset($lang_translator['info']) ? strip_tags($lang_translator['info']) : "";
            $lang_translator_save['langtype'] = $langtype;
            //$author = base64_encode( serialize( $lang_translator_save ) );
            $author = var_export($lang_translator_save, true);
            $idfile = $db->sql_query_insert_id("INSERT INTO `" . NV_LANGUAGE_GLOBALTABLE . "_file` (`idfile`, `module`, `admin_file`, `langtype`, `author_" . $dirlang . "`) VALUES (NULL, " . $db->dbescape($module) . ", " . $db->dbescape($admin_file) . ", " . $db->dbescape($langtype) . ", '" . mysql_real_escape_string($author) . "')");
            if (!$idfile) {
                nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], "Error insert file: " . $filelang);
            }
        } else {
            $lang_translator_save = array();
            $langtype = isset($lang_translator['langtype']) ? strip_tags($lang_translator['langtype']) : "lang_module";
            $lang_translator_save['author'] = isset($lang_translator['author']) ? strip_tags($lang_translator['author']) : "VINADES.,JSC (contact@vinades.vn)";
            $lang_translator_save['createdate'] = isset($lang_translator['createdate']) ? strip_tags($lang_translator['createdate']) : date("d/m/Y, H:i");
            $lang_translator_save['copyright'] = isset($lang_translator['copyright']) ? strip_tags($lang_translator['copyright']) : "Copyright (C) 2010 VINADES.,JSC. All rights reserved";
            $lang_translator_save['info'] = isset($lang_translator['info']) ? strip_tags($lang_translator['info']) : "";
            $lang_translator_save['langtype'] = $langtype;
            //$author = base64_encode( serialize( $lang_translator_save ) );
            $author = var_export($lang_translator_save, true);
            $sql = "UPDATE `" . NV_LANGUAGE_GLOBALTABLE . "_file` SET `author_" . $dirlang . "` = '" . mysql_real_escape_string($author) . "' WHERE `idfile` = '" . $idfile . "'";
            $db->sql_query($sql);
        }
        $temp_lang = array();
        switch ($langtype) {
            case 'lang_global':
                $temp_lang = $lang_global;
                break;
            case 'lang_module':
                $temp_lang = $lang_module;
                break;
            case 'lang_block':
                $temp_lang = $lang_block;
                break;
        }
        $result = $db->sql_query("SHOW COLUMNS FROM `" . NV_LANGUAGE_GLOBALTABLE . "_file`");
        $add_field = true;
        $array_lang_key = array();
        $array_lang_value = array();
        while ($row = $db->sql_fetch_assoc($result)) {
            if (substr($row['Field'], 0, 7) == "author_" and $row['Field'] != "author_" . $dirlang) {
                $array_lang_key[] = str_replace("author_", "lang_", $row['Field']);
                $array_lang_value[] = "";
            }
        }
        $string_lang_key = implode("`, `", $array_lang_key);
        $string_lang_value = "";
        if ($string_lang_key != "") {
            $string_lang_key = ", `" . $string_lang_key . "`";
            $string_lang_value = implode("', '", $array_lang_value);
            $string_lang_value = ", '" . $string_lang_value . "'";
        }
        $read_type = intval($global_config['read_type']);
        while (list($lang_key, $lang_value) = each($temp_lang)) {
            $check_type_update = false;
            $lang_key = trim($lang_key);
            $lang_value = nv_nl2br($lang_value);
            $lang_value = str_replace('<br  />', '<br />', $lang_value);
            $lang_value = str_replace('<br />', '<br />', $lang_value);
            if ($read_type == 0 or $read_type == 1) {
                $sql = "INSERT INTO `" . NV_LANGUAGE_GLOBALTABLE . "` (`id`, `idfile`, `lang_key`, `lang_" . $dirlang . "`, `update_" . $dirlang . "` " . $string_lang_key . ") VALUES (NULL, '" . $idfile . "', '" . mysql_real_escape_string($lang_key) . "', '" . mysql_real_escape_string($lang_value) . "',  UNIX_TIMESTAMP( ) " . $string_lang_value . ")";
                if (!$db->sql_query_insert_id($sql) and $read_type == 0) {
                    $check_type_update = true;
                }
            }
            if ($read_type == 2 or $check_type_update) {
                $sql = "UPDATE `" . NV_LANGUAGE_GLOBALTABLE . "` SET `lang_" . $dirlang . "` = '" . mysql_real_escape_string($lang_value) . "',  `update_" . $dirlang . "` =  UNIX_TIMESTAMP( ) WHERE `idfile` = '" . $idfile . "' AND `lang_key` = '" . mysql_real_escape_string($lang_key) . "' LIMIT 1";
                $db->sql_query($sql);
            }
        }
        $lang_module = $lang_module_temp;
        return "";
    } else {
        $include_lang = "";
        return $lang_module['nv_error_exit_module'] . " : " . $module;
    }
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:101,代码来源:read.php


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