USE [WordFilter]
GO
/****** Object: Table [dbo].[T_Review] Script Date: 07/20/2014 18:27:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_Review](
[id] [int] IDENTITY(1,1) NOT NULL,
[body] [nvarchar](max) NULL,
[nid] [int] NOT NULL,
[Isvisable] [bit] NULL,
CONSTRAINT [PK_T_Review] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[T_new] Script Date: 07/20/2014 18:27:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_new](
[id] [int] IDENTITY(1,1) NOT NULL,
[title] [nvarchar](50) NULL,
[body] [nvarchar](max) NULL,
[chahhelid] [int] NULL,
[ntime] [datetime] NULL,
CONSTRAINT [PK_T_new] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[T_FilterWords] Script Date: 07/20/2014 18:27:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_FilterWords](
[id] [int] IDENTITY(1,1) NOT NULL,
[WordPattern] [nvarchar](50) NULL,
[ReplaceWord] [nvarchar](50) NULL,
CONSTRAINT [PK_T_FilterWords] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[T_Channels] Script Date: 07/20/2014 18:27:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_Channels](
[Id] [int] IDENTITY(1,1) NOT NULL,
[ParentId] [int] NOT NULL,
[Name] [nvarchar](50) NULL,
CONSTRAINT [PK_T_Channels] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
<script src="/js/xheditor/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
<script src="/js/xheditor/xheditor_plugins/ubb.min.js" type="text/javascript"></script>
<script src="/js/xheditor/ubb2html.js" type="text/javascript"></script>
<script type="text/javascript">
var url = window.location.host;
function submitForm() {
var nid = $("#nid").val();
var body = $("#pingnew").val();
$.post("http://" + url + "/Front1/ashx/postCommon.ashx",
{ nid: nid, body: body },
function (data) {
if (data == "ok") {
var valueli = body;
valueli = "<li>" + ubb2html(valueli) + "</li>";
$("#pp > ul").append(valueli);
$("#pingnew").val("");
}
else if (data == "mod") {
alert("含有审核词,等待管理员审核");
}
else if (data == "banned") {
alert("含有禁用词,请认真填写评论,文明用语");
}
else {
alert("错误");
}
});
}
$(document).ready(function () {
var nid = $("#nid").val();
$("#btnPing").click(submitForm);
$.getJSON("http://" + url + "/Front1/ashx/getNews.ashx?nid=" + nid,
function (data) {
$.each(data, function (i, item) {
var valueli = item.body ;
valueli = "<li>" + ubb2html(valueli) + "</li>";
$("#pp > ul").append(valueli);
});
});
var plugins = {
Code: { c: 'btnCode', t: '插入代码', h: 1, e: function () {
var _this = this;
var htmlCode = '<div><select id="xheCodeType"><option value="html">HTML/XML</option><option value="js">Javascript</option><option value="css">CSS</option><option value="php">PHP</option><option value="java">Java</option><option value="py">Python</option><option value="pl">Perl</option><option value="rb">Ruby</option><option value="cs">C#</option><option value="c">C++/C</option><option value="vb">VB/ASP</option><option value="">其它</option></select></div><div><textarea id="xheCodeValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>'; var jCode = $(htmlCode), jType = $('#xheCodeType', jCode), jValue = $('#xheCodeValue', jCode), jSave = $('#xheSave', jCode);
jSave.click(function () {
_this.loadBookmark();
_this.pasteText('[code=' + jType.val() + ']\r\n' + jValue.val() + '\r\n[/code]');
_this.hidePanel();
return false;
});
_this.saveBookmark();
_this.showDialog(jCode);
}
},
Flv: { c: 'btnFlv', t: '插入Flv视频', h: 1, e: function () {
var _this = this;
var htmlFlv = '<div>Flv文件: <input type="text" id="xheFlvUrl" value="http://" class="xheText" /></div><div>宽度高度: <input type="text" id="xheFlvWidth" style="width:40px;" value="480" /> x <input type="text" id="xheFlvHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>';
var jFlv = $(htmlFlv), jUrl = $('#xheFlvUrl', jFlv), jWidth = $('#xheFlvWidth', jFlv), jHeight = $('#xheFlvHeight', jFlv), jSave = $('#xheSave', jFlv);
jSave.click(function () {
_this.loadBookmark();
_this.pasteText('[flv=' + jWidth.val() + ',' + jHeight.val() + ']' + jUrl.val() + '[/flv]');
_this.hidePanel();
return false;
});
_this.saveBookmark();
_this.showDialog(jFlv);
}
}
}, emots = {
msn: { name: 'MSN', count: 40, width: 22, height: 22, line: 8 },
pidgin: { name: 'Pidgin', width: 22, height: 25, line: 8, list: { smile: '微笑', cute: '可爱', wink: '眨眼', laugh: '大笑', victory: '胜利', sad: '伤心', cry: '哭泣', angry: '生气', shout: '大骂', curse: '诅咒', devil: '魔鬼', blush: '害羞', tongue: '吐舌头', envy: '羡慕', cool: '耍酷', kiss: '吻', shocked: '惊讶', sweat: '汗', sick: '生病', bye: '再见', tired: '累', sleepy: '睡了', question: '疑问', rose: '玫瑰', gift: '礼物', coffee: '咖啡', music: '音乐', soccer: '足球', good: '赞同', bad: '反对', love: '心', brokenheart: '伤心'} },
ipb: { name: 'IPB', width: 20, height: 25, line: 8, list: { smile: '微笑', joyful: '开心', laugh: '笑', biglaugh: '大笑', w00t: '欢呼', wub: '欢喜', depres: '沮丧', sad: '悲伤', cry: '哭泣', angry: '生气', devil: '魔鬼', blush: '脸红', kiss: '吻', surprised: '惊讶', wondering: '疑惑', unsure: '不确定', tongue: '吐舌头', cool: '耍酷', blink: '眨眼', whistling: '吹口哨', glare: '轻视', pinch: '捏', sideways: '侧身', sleep: '睡了', sick: '生病', ninja: '忍者', bandit: '强盗', police: '警察', angel: '天使', magician: '魔法师', alien: '外星人', heart: '心动'} }
};
$('#pingnew').xheditor({ plugins: plugins, tools: 'full', showBlocktag: false, forcePtag: false, beforeSetSource: ubb2html, beforeGetSource: html2ubb, emots: emots, emotMark: true, shortcuts: { 'ctrl+enter': submitForm} });
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<input type="hidden" id="nid" value='<%=nid%>' />
<h2>
<%=title%></h2>
<p>
<%=body%>
</p>
<div style="color: Red;">
评论区:
</div>
<div id="pp">
<ul>
</ul>
</div>
<div>
<textarea id="pingnew" name="pingnew" rows="12" cols="80"></textarea>
<p>
<input type="button" id="btnPing" value="提交评论" /></p>
评论通过ajax提交和获取,有助于下一片 的
页面真静态教程