ID: TMS_CodeHighLighter
名称: 茗伊代码高亮着色(基于SyntaxHighlighter开发)
作者: tinymins
发布:
简介:

  1. 启用该插件可高亮着色展示您的代码。此插件基于SyntaxHighlighter开发,无需管理,启用即可。
  2. 【具体使用方法见管理页面】建议代码键入方式为:可视编辑->粘贴为无格式文本->
    [code language="language"]your code[/code]

    3.该插件不修改网站的Template模版,不修改数据库内容,关闭后重建即可恢复原始状态。
    适用:
    版本: 2.0.01
    修正: 2012-06-17

    [URL=upload/TMS_CodeHighLighter.rar]TMS_CodeHighLighter.rar[/URL]

预览:

//C++代码着色
#pragma once
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <gl\glut.h>
using namespace std;
HWND hWnd;
GLint winWidth = 1273, winHeight = 737;
GLint x0 = 0, y_0 = 0;
const int viewWidth = 400, viewHeight = 600;     //方块区域,非坐标范围
int grid [33][23];   //最上3行不显示 为了防止越界
int curMatrix_n = 0;     //当前方块编号
int curMatrix_f = 0;     //当前方块形状(form)编号
const int initCurMatrix_j = 27;  //初始化当前方块最左下格子 行列值
const int initCurMatrix_i = 9;
int curMatrix_j = 0;     //当前方块最左下格子 行列值,j为行 向上递增(Y轴),i为列 向右递增(X轴)
int curMatrix_i = 0;
int initCurMatrix_x = 0;     //当前方块初始化时最左下格 左下角坐标,需计算
int initCurMatrix_y = 0;
int curMatrix_x = 0;     //当前方块最左下格子 左下角坐标
int curMatrix_y = 0;
bool needNewMatrix = 1;  //是否需要生成新方块
bool isOver = 0;
UINT_PTR timer;
const int LEFT = 3;
const int RIGHT = 4;
const int DOWN = 2;
//********************************************************************************************************************
//7种方块,编号n= 0~6
//每一种方块有4种形态 有重复,编号f=0~3
//每个方块形态 为5*6矩阵 [k][l]
int curMatrix [7][4][5][6] = {
{   //0
{
{0,2,2,0,0,0},
{3,1,1,4,0,0},
{3,1,1,4,0,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}},
{
{0,2,2,0,0,0},
{3,1,1,4,0,0},
{3,1,1,4,0,0},
{0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,1,4},
{0,0,0,0,0,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}
}
},
{   //4
{
{0,2,2,2,0,0},
{3,1,1,1,4,0},
{0,3,1,4,0,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}},
{
{0,0,2,0,0,0},
{0,6,1,4,0,0},
{3,1,1,4,0,0},
{0,3,1,4,0,0},
{0,0,0,0,0,0}},
{
{0,0,2,0,0,0},
{0,6,1,8,0,0},
{3,1,1,1,4,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}},
{
{0,2,0,0,0,0},
{3,1,8,0,0,0},
{3,1,1,4,0,0},
{3,1,4,0,0,0},
{0,0,0,0,0,0}
}
},
{   //5
{
{0,0,2,0,0,0},
{0,3,1,4,0,0},
{0,6,1,4,0,0},
{3,1,1,4,0,0},
{0,0,0,0,0,0}},
{
{0,2,0,0,0,0},
{0,1,8,2,0,0},
{3,1,1,1,4,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}},
{
{0,2,2,0,0,0},
{3,1,1,4,0,0},
{3,1,4,0,0,0},
{3,1,4,0,0,0},
{0,0,0,0,0,0}},
{
{0,2,2,2,0,0},
{3,1,1,1,4,0},
{0,0,0,1,4,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}
}
},
//int curMatrix6 [4][5][6] =
{   //6
{
{0,2,0,0,0,0},
{3,1,4,0,0,0},
{3,1,8,0,0,0},
{3,1,1,4,0,0},
{0,0,0,0,0,0}},
{
{0,2,2,2,0,0},
{3,1,1,1,4,0},
{3,1,4,0,0,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}},
{
{0,2,2,0,0,0},
{3,1,1,4,0,0},
{0,0,1,4,0,0},
{0,0,1,4,0,0},
{0,0,0,0,0,0}},
{
{0,0,0,2,0,0},
{0,2,6,1,4,0},
{3,1,1,1,4,0},
{0,0,0,0,0,0},
{0,0,0,0,0,0}
}
}
};
<!--HTML代码着色-->
<html>
  <head>
    <title>我的第一个 HTML 页面</title>
  </head>
  <body>
    <p>body 元素的内容会显示在浏览器中。</p>
    <p>title 元素的内容会显示在浏览器的标题栏中。</p>
  </body>
</html>
'VB代码着色
Private Sub Command1_Click()
    If File1.ListIndex < File1.ListCount - 1 Then
        Me.File1.ListIndex = File1.ListIndex + 1
    Else
        Me.File1.ListIndex = File1.ListIndex
    End If
End Sub
Private Sub Command2_Click()
    If File1.ListIndex > 0 Then
        Me.File1.ListIndex = File1.ListIndex - 1
    Else
        Me.File1.ListIndex = 0
    End If
End Sub
/*CSS代码着色*/
#Star1 {
    position: absolute;
    z-index: 20;
    height: 30px;
    width: 30px;
}
#Star2 {
    position: absolute;
    z-index: 19;
    height: 30px;
    width: 60px;
}
#Star3 {
    position: absolute;
    z-index: 18;
    height: 30px;
    width: 90px;
}
#Star4 {
    position: absolute;
    z-index: 17;
    height: 30px;
    width: 120px;
}
#Star5 {
    position: absolute;
    z-index: 16;
    height: 30px;
    width: 150px;
}
#Star1:hover, #Star2:hover, #Star3:hover, #Star4:hover, #Star5:hover {
    background-image: url(/Blog/PLUGIN/Rating/star.gif);
    background-position: -30px;
}
/*JavaScript代码着色*/
//*********************************************************
// 目的: 加载样式表
// 输入: 无
// 返回: 无
//*********************************************************
function LoadActiveStyleSheet(){
var title=GetCookie("sk");
var a;
if (title) {
a = document.getElementsByTagName("link")[0];
a.href=str00+"style/"+title+".css";
}
}