I saw him at the monk, and he added a code function to Z-blog, put a few days off, some afraid of this idle will be rusty, after 1.5 hours of sleep, but also to the Blog and run function, because it is modified from L-blog, so the same applies to l-blog, in addition, FBS is also l-blog modified, and you should also use the methods in this article to add the run code functionality. In addition, since the copy code and the Save code have not yet found a compatible solution for each browser, they are not added.
Example:
The steps are as follows:
1. Add the following code to the Include/common.js:
Copy Code code as follows:
function RunCode (Codeobjid) {
var Codeobj=document.getelementbyid (Codeobjid)
var Codestr=codeobj.value;
if (codestr!= "") {
var codewin=window.open (', ', ', ');
Codewin.document.open (' text/html ', ' replace ');
Codewin.opener = null
Codewin.document.write (CODESTR);
Codewin.document.close ();
}
}
2. Find Strcontent=re in include/ubbcode.asp. Replace (strcontent, "code") (replace "" with []), add the following code after this:
L-blog:
Copy Code code as follows:
Re. Pattern= "\[html\] (<br>) +"
Strcontent=re. Replace (strcontent, "html")
FBS:
Copy Code code as follows:
Re. Pattern= "\[html\] (<br/>) +"
Strcontent=re. Replace (strcontent, "html")
Find the re again. Pattern= "\[code\]" (. *?) \[\/code\], and then add the following code after the Set strmatches=nothing of the segment code:
Copy Code code as follows:
Re. Pattern= "\[html\]" (. *?) \[\/html\] "
Set Strmatches=re. Execute (strcontent)
For each strmatch in strmatches
Rndstr=int (7999 * Rnd + 2000)
Tmpstr1=strmatch.submatches (0)
Strcontent= Replace (Strcontent,strmatch.value, "<textarea rows=" "10" "" _
& "style=" "width:90%" "class=" "Input_border" "id=" "Html_" &RNDStr& "" > "_
&tmpStr1& "</textarea><br/>" _
& "<input type=" button "onclick=" RunCode (' Html_ "&RNDStr&"); "" Value= "" Run Code ""/> "_
& "[Ctrl + a All SELECT tips: You can modify some of the code, and then run]")
Next
Set strmatches=nothing
3. After the modification is complete, you can use the code "/html" to run using "HTML" (replace "" with []) to run the code function when you publish the log.