zblog升级之后感觉熟悉下之后感觉还不错,文本编辑器使用的是百度的ueditor,这个是免费的开源的HTML在线编辑器,在之前学习php的时候有用到过,因为本人喜欢敲点小代码什么的,希望能够在自己的博客上贴出来,但是发布文章的时候找了下没看到这个功能按钮,便查看了下配置文件,原来被系统隐藏了。只需要修改一个地方就可以在文本编辑器中显示出来。
在zb_system/ADMIN/ueditor/editor_config.asp 在这里搜索“oDic.Add "toolbars"”然后看到后面的一个""&IIf(ZC_SYNTAXHIGHLIGHTER_ENABLE,"'highlightcode',","")&"" 将这句改为:'highlightcode', , 最后这句附近前后的代码是这样的
|', 'highlightcode','blockquote', 'pasteplain','wordimage','inserttable', '|
这样弄下就好了哈 发布个文章试试看,是不是在谷歌地图的右边有了个插入代码的按钮了呢。最后是在前台显示页面加上一段代码
<link href="http://luyugao.com/zb_system/ADMIN/ueditor/third-party/SyntaxHighlighter/shCoreDefault.pack.css" rel="stylesheet" type="text/css" /> <script src="http://luyugao.com/zb_system/ADMIN/ueditor/third-party/SyntaxHighlighter/shCore.pack.js" type="text/javascript"></script> <script type="text/javascript"> SyntaxHighlighter.all(); </script>
就是引入一个css文件,一个js文件和执行一个 SyntaxHighlighter.all(); 方法
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Hello World"); } } }
这个是C#的演示代码。