<?php
header('Content-type: text/html; charset=utf-8');
// The following variables values must reflect your installation needs.
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
$lang = 'en_US';
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
$tempfiledir = "./";
$spellercss = '../spellerStyle.css'; // by FredCK
$word_win_src = '../wordWindow.js'; // by FredCK
$textinputs = $_POST['textinputs']; # array
$input_separator = "A";
# set the JavaScript variable to the submitted text.
# textinputs is an array, each element corresponding to the (url-encoded)
# value of the text control submitted for spell-checking
function print_textinputs_var() {
global $textinputs;
foreach( $textinputs as $key=>$val ) {
# $val = str_replace( "'", "%27", $val );
echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
}
}
# make declarations for the text input index
function print_textindex_decl( $text_input_idx ) {
echo "words[$text_input_idx] = [];\n";
echo "suggs[$text_input_idx] = [];\n";
}
# set an element of the JavaScript 'words' array to a misspelled word
function print_words_elem( $word, $index, $text_input_idx ) {
echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
}
# set an element of the JavaScript 'suggs' array to a list of suggestions
function print_suggs_elem( $suggs, $index, $text_input_idx ) {
echo "suggs[$text_input_idx][$index] = [";
foreach( $suggs as $key=>$val ) {
if( $val ) {
echo "'" . escape_quote( $val ) . "'";
if ( $key+1 < count( $suggs )) {
echo ", ";
}
}
}
echo "];\n";
}
# escape single quote
function escape_quote( $str ) {
return preg_replace ( "/'/", "\\'", $str );
}
# handle a server-side error.
function error_handler( $err ) {
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
}
## get the list of misspelled words. Put the results in the javascript words array
## for each misspelled word, get suggestions and put in the javascript suggs array
function print_checker_results() {
global $aspell_prog;
global $aspell_opts;
global $tempfiledir;
global $textinputs;
global $input_separator;
$aspell_err = "";
# create temp file
$tempfile = tempnam( $tempfiledir, 'aspell_data_' );
# open temp file, add the submitted text.
if( $fh = fopen( $tempfile, 'w' )) {
for( $i = 0; $i < count( $textinputs ); $i++ ) {
$text = urldecode( $textinputs[$i] );
// Strip all tags for the text. (by FredCK - #339 / #681)
$text = preg_replace( "/<[^>]+>/", " ", $text ) ;
$lines = explode( "\n", $text );
fwrite ( $fh, "%\n" ); # exit terse mode
fwrite ( $fh, "^$input_separator\n" );
fwrite ( $fh, "!\n" ); # enter terse mode
foreach( $lines as $key=>$value ) {
# use carat on each line to escape possible aspell commands
fwrite( $fh, "^$value\n" );
}
}
fclose( $fh );
# exec aspell command - redirect STDERR to STDOUT
$cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
if( $aspellret = shell_exec( $cmd )) {
$linesout = explode( "\n", $aspellret );
$index = 0;
$text_input_index = -1;
# parse each line of aspell return
foreach( $linesout as $key=>$val ) {
$chardesc = substr( $val, 0, 1 );
# if '&', then not in dictionary but has suggestions
# if '#', then not in dictionary and no suggestions
# if '*', then it is a delimiter between text inputs
# if '@' then version info
if( $chardesc == '&' || $chardesc == '#' ) {
$line = explode( " ", $val, 5 );
print_words_elem( $line[1], $index, $text_input_index );
if( isset( $line[4] )) {
$suggs = explode( ", ", $line[4] );
} else {
$suggs = array();
}
print_suggs_elem( $suggs, $index, $text_input_index );
$index++;
} elseif( $chardesc == '*' ) {
$text_input_index++;
print_textindex_decl( $text_input_index );
$index = 0;
} elseif( $chardesc != '@' && $chardesc != "" ) {
# assume this is error output
$aspell_err .= $val;
}
}
if( $aspell_err ) {
$aspell_err = "Error executing `$cmd`\\n$aspell_err";
error_handler( $aspell_err );
}
} else {
error_handler( "System error: Aspell program execution failed (`$cmd`)" );
}
} else {
error_handler( "System error: Could not open file '$tempfile' for writing" );
}
# close temp file, delete file
unlink( $tempfile );
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
<script language="javascript" src="<?php echo $word_win_src ?>"></script>
<script language="javascript">
var suggs = new Array();
var words = new Array();
var textinputs = new Array();
var error;
<?php
print_textinputs_var();
print_checker_results();
?>
var wordWindowObj = new wordWindow();
wordWindowObj.originalSpellings = words;
wordWindowObj.suggestions = suggs;
wordWindowObj.textInputs = textinputs;
function init_spell() {
// check if any error occured during server-side processing
if( error ) {
alert( error );
} else {
// call the init_spell() function in the parent frameset
if (parent.frames.length) {
parent.init_spell( wordWindowObj );
} else {
alert('This page was loaded outside of a frameset. It might not display properly');
}
}
}
</script>
</head>
<!-- <body onLoad="init_spell();"> by FredCK -->
<body onLoad="init_spell();" bgcolor="#ffffff">
<script type="text/javascript">
wordWindowObj.writeBody();
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
程序源码 AyWeb企业网站管理系统 v2.6.3 多站多语言版_ayweb2(ASP.NET源码).rar
共1735个文件
gif:1168个
aspx:108个
htm:101个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 173 浏览量
2023-03-12
08:09:25
上传
评论
收藏 4.79MB RAR 举报
温馨提示
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,本人不对所涉及的版权问题或内容负法律责任。如有侵权,请举报或通知本人删除。
资源推荐
资源详情
资源评论
收起资源包目录
程序源码 AyWeb企业网站管理系统 v2.6.3 多站多语言版_ayweb2(ASP.NET源码).rar (1735个子文件)
config.ascx 5KB
PublishSite_Add.aspx 25KB
PublishSite_Update.aspx 23KB
Config.aspx 23KB
Language_Add.aspx 20KB
Frame_DeskTop.aspx 14KB
Article_Add.aspx 13KB
Product_Import.aspx 13KB
FrameContentRightTop.aspx 11KB
Product_Add.aspx 11KB
DownLoad_Add.aspx 10KB
Frame_Top.aspx 9KB
System_Template.aspx 9KB
Admin_Add.aspx 9KB
WebMenu_Add.aspx 8KB
User_Add.aspx 8KB
User_Modify.aspx 8KB
SiteMap.aspx 7KB
Kf.aspx 7KB
Template_List.aspx 6KB
PublishSite.aspx 6KB
Class_Add.aspx 6KB
System_Template_List.aspx 6KB
Make_Product.aspx 6KB
Make_DownLoad.aspx 6KB
Make_Article.aspx 6KB
Access.aspx 6KB
WebMenu_Update.aspx 6KB
PublishSite_InputData.aspx 5KB
PublishSite_Browse.aspx 5KB
DownLoad_Browse.aspx 5KB
Product_Browse.aspx 5KB
Article_Browse.aspx 5KB
Vote_Browse.aspx 5KB
Vote_Add.aspx 5KB
Frame_Bottom.aspx 5KB
Product.aspx 5KB
Article.aspx 5KB
Admin.aspx 5KB
PublishSite_fy.aspx 4KB
DownLoad.aspx 4KB
PublishSite_Template.aspx 4KB
Kf_Add.aspx 4KB
Class.aspx 4KB
BBS.aspx 4KB
Class_Update.aspx 4KB
Vote_GetCode.aspx 4KB
ClassBrowse.aspx 4KB
Language.aspx 4KB
WebMenu.aspx 4KB
Company_Add.aspx 4KB
Data.aspx 4KB
WebMenuBrowse.aspx 4KB
Company_Browse.aspx 4KB
JobPerson.aspx 4KB
Order.aspx 4KB
User.aspx 3KB
Rss.aspx 3KB
JobPerson_View.aspx 3KB
Job_Add.aspx 3KB
BBS_Write.aspx 3KB
UploadPicForm.aspx 3KB
Default.aspx 3KB
Counter.aspx 3KB
Job.aspx 3KB
User_Left.aspx 3KB
Announce.aspx 3KB
Link.aspx 3KB
Link_Add.aspx 3KB
Vote.aspx 3KB
Admin_Log.aspx 3KB
User_Log.aspx 3KB
SearchForm.aspx 3KB
System_Template_Add.aspx 3KB
Ftp_Default.aspx 3KB
Company.aspx 3KB
Order_View.aspx 3KB
User_Main.aspx 2KB
Announce_Add.aspx 2KB
User_Pwd.aspx 2KB
ClassOrder.aspx 2KB
WebMenuOrder.aspx 2KB
User_Top.aspx 2KB
System_Template_Config.aspx 2KB
Admin_Pwd.aspx 2KB
Template_Add.aspx 2KB
Error.aspx 2KB
ClassMove.aspx 2KB
Make_Company.aspx 2KB
WebMenuMove.aspx 2KB
UploadTemplateForm.aspx 1KB
UploadFileForm.aspx 1KB
Product_Upload.aspx 1KB
connector.aspx 1KB
upload.aspx 1KB
FrameContentMenu.aspx 1KB
FrameMenuLeft.aspx 1KB
Frame_Index.aspx 803B
Make_Index.aspx 387B
Ftp_Delete.aspx 371B
共 1735 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
资源评论
金枝玉叶9
- 粉丝: 198
- 资源: 7637
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 形状分类31-YOLO(v5至v11)、COCO、CreateML、Darknet、Paligemma、VOC数据集合集.rar
- 常见排序算法概述及其性能比较
- 前端开发中的JS快速排序算法原理及实现方法
- 基于Java的环境保护与宣传网站论文.doc
- 基于8086的电子琴程序Proteus仿真
- 基于java的二手车交易网站的设计和实现论文.doc
- 纯真IP库,用于ip查询地址使用的数据库文件
- 基于javaweb的动漫网站管理系统毕业设计论文.doc
- 废物垃圾检测28-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 探索CSDN博客数据:使用Python爬虫技术
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功