private string NewsContent(string content)
{
string[] Contents = UserCommand.SC.SplitString(content, "[NextPage]");
int LenContent = Contents.Length;
if (LenContent > 1)
{
System.Text.StringBuilder NewContent = new System.Text.StringBuilder();
for (int index = 0; index < LenContent; index++)
{
if (index == 0)
{
NewContent.Append("<div id=\"Div_Page_");
NewContent.Append(index);
NewContent.Append("\">");
NewContent.Append(Contents[index]);
NewContent.Append("</div>");
}
else
{
NewContent.Append("<div id=\"Div_Page_");
NewContent.Append(index);
NewContent.Append("\" style=\"display:none\">");
NewContent.Append(Contents[index]);
NewContent.Append("</div>");
}
}
NewContent.Append("<div id=\"Div_Page_Footer\">分页:");
for (int index = 0; index < LenContent; index++)
{
NewContent.Append("<span><a class=\"a_blue\" href=\"#\" onclick=\"javascript:DisplayPage(");
NewContent.Append(index);
NewContent.Append(")\">[");
NewContent.Append(index+1);
NewContent.Append("]</a></span> ");
}
NewContent.Append("<script type=\"text/javascript\"> function DisplayPage(pageIndex) { for(var i=0;i<");
NewContent.Append(LenContent);
NewContent.Append(";i++) { $('Div_Page_'+i).style.display = ((i == pageIndex) ? '' : 'none'); } } DisplayPage(0);</script></div>");
return NewContent.ToString();
}
else
{
return content;
}
}
在内容编辑器里加入js
function innnextpage() {
if(wysiwyg && bbinsert) {
var aaa=editdoc.body.innerHTML+'[NextPage]';
editdoc.body.innerHTML=aaa ;
}
}