discuz!5.0 Forum display style PHP code highlighting plugin,
The PHP code syntax coloring, like a comrade PHP can easily see the code.
Also added the HTML code run function.
This plugin was modified on the basis of a previous comrade's discuz!4 PHP code highlighting.
In addition, my PHP learning into a stagnant state,
I hope someone can help me out of the learning predicament of PHP
My qq:5642382 QQ group: 2577162
Function: When posting, use [php]php code [/php] tag to highlight the PHP code,
Use the [runcode]html code [/runcode] tag to run the HTML code (non-server running on the client).
plug-in add steps as follows: 1. Modify Include/common.js
Find
function Copycode (obj) {
var rng = Document.body.createTextRange ();
Rng.movetoelementtext (obj);
Rng.scrollintoview ();
Rng.select ();
Rng.execcommand ("Copy");
Rng.collapse (FALSE);
}
At the end of this function, add the following:
[Copy to Clipboard] [ - ] CODE:
function RunCode (obj) {
var winname = window.open ("," _blank ",");
Winname.document.open (' text/html ', ' replace ');
Winname.document.writeln (Obj.value);
Winname.document.close ();
}
[Copy to Clipboard] [ - ] CODE:
$discuzcodes [' Codecount ']++;
Return "[\tdiscuz_code_$discuzcodes[pcodecount]\t]";
}
(Note: You can also use EditPlus directly to find the 110th line of code to do the following add)
Continue to add below:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service