In some casesArticleThe website link in the content must be automatically converted into a hyperlink for certain settings.
Assume that the content of the article is "HTML needs to be filtered in many casesCodeOnly plain text is displayed. The following function can be used to achieve the effect ." The "filter", "html", and "function" must be automatically set as hyperlinks to achieve this effect. "In many cases, HTML code in the content must be filtered to only display plain text, use the following function to achieve the effect."
For intra-site search, you can use the first function to perform full-site search. If you refer to different URLs, you can use the second function. The Code is as follows:
Code1:
Function linkstr (STR) <br/> dim str_1, str_2, str_3, str_4 <br/> str_1 = "filter, HTML, function" <br/> str_2 = Split (str_1, ",") <br/> for each str_3 in str_2 <br/> If Len (str_4) = 0 then <br/> str_4 = Replace (str_4, str_3, "<a href =" http://www.wuhane.com/tech? Key = "mce_href =" http://www.wuhane.com/tech? Key = "" & str_3 & ">" & str_3 & "</a>") <br/> next <br/> linkstr = str_4 <br/> end Function
Code2:
Function linkstr (STR) <br/> dim str_1, str_2, str_3, str_4, str_5, str_6 <br/> str_1 = "filter -1.htm,html-2.htm,#-3.htm" <br/> str_2 = Split (str_1, ",") <br/> for each str_3 in str_2 <br/> str_5 = mid (str_3, (instr (str_3, "-") + 1 )) <br/> str_6 = Replace (str_3, ("-" & str_5), "") <br/> If Len (str_4) = 0 then <br/> str_4 = STR <br/> end if <br/> str_4 = Replace (str_4, str_6, "<a href =" & str_5 & "mce_href =" & str_5 & ">" & str_6 & "</a> ") <br/> next <br/> linkstr = str_4 <br/> end Function
Use the following code to test function reference on the page:
Content = "in many cases, HTML code in the content needs to be filtered out, only plain text is displayed, and the following function can be used to achieve the effect. "</P> <p> response. Write linkstr (content) <br/>
in variable str_1, multiple keywords are separated by the comma, in code2, use the "-" interval between keywords and URLs.