Discuz X2 post tools and collection tools (original)

Source: Internet
Author: User

Because it is a winform program, please ensure that your computer has installed. netframework2.0 or later.

This section describes the functions of the text box button on the interface. The following uses Xiamen art network as an example:

Source: http://www.xmysw.cn/portal.php? MoD = List & catid = 2

Link: article

In this way, you can obtain the list of all links with the link containing the article. This is basically the list of articles in the source.

You can also process the title, for example, the title contains Xiamen; you can also replace the content of the title in the format of the original content => new content, the two replacement specifications are separated by |, for example, Xiamen => Fujian | art => art network. In this way, Xiamen and art in the title will be replaced with Fujian and art network respectively, the following content is replaced in the same format. Because discuz X2 title length is limited, the system provides the title length check function. Click "Check title" and you will be prompted that the title is too long. The system will add "the title is too long" before the title that is too long (more than 80 characters by default... ", find these titles and modify them to 80 characters or less.

Next, you can open a news content page. For IE8 or later versions or Firefox press the F12 pop-up tool, select the news content tag, and enter (DIV, TD) on the Content tag, here is TD. Enter id = XX or class = xxx in the tag rule. It depends on how the content page is defined. Here is id = article_content. Note, all characters here are in halfwidth format. After filling in, you can fill in the replacement format in the content replacement. if the content is the same as the title replacement, it will not be explained. After entering the content, the system will automatically parse the link to obtain the content and fill it in the content of the list article. If "content that meets the conditions is not found" is displayed, check whether the content label and label rule are correct.

The next step is posting. Open the forum posting page, copy the address and enter the posting address. Click Preview logon. The logon page is displayed. If a topic category is set, the topic category on the post page is automatically loaded after the post page is loaded. Select the topic category you want to publish. If no topic category is set, click "No topic category.

After the settings are completed, click Start post. The system will automatically retrieve the post title and content from the list for posting. Note that if the post content contains images, install the remote image localization plug-in to solve this problem perfectly. For details about the remote image localization plug-in, refer to discuz! X1.5/x2.0 remote image localization plugin http://www.kuangren.cn/thread-649429-1-1.html

 

To be able to post, you have to go to static/JS/forum. add a JS function in JS and use the FTP tool to download static/JS/forum. JS, add the following code to any location to overwrite the website.

function html_trans(html,lb){    var str = html;    str = str.replace(/\r/g,"");    str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)=("|')?[^>]+?\2(?: |>)/ig,"");    str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");    str = str.replace(/<span[^>]*?display\s*?:\s*?none[^>]*?>([\w\W]*?)<\/span>/ig,"");    str = str.replace(/<span[^>]*?font\s*?-\s*?size\s*?:\s*(0px|0pt)[^>]*?>([\w\W]*?)<\/span>/ig,"");    str = str.replace(/<font([^>]+)(0px|0pt)+([^>]*)>([\w\W]*?)<\/font>/ig,"");    str = str.replace(/<a[^>]+href=[" ]?([^"]+)[" ]?[^>]*>(.*?)<\/a>/ig,"[url=$1]$2[/url]");    str = str.replace(/<font([^>]+)color=([^ >]+)([^>]*)>(.*?)<\/font>/ig,"[color=$2]<font$1$3>$4</font>[/color]");    str = str.replace(/<font([^>]+)size=([^ >]+)([^>]*)>(.*?)<\/font>/ig,"[size=$2]<font$1$3>$4</font>[/size]");    str = str.replace(/<font[^>]+face=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[font=$1]$2[/font]");    str = str.replace(/]+src=[" ]?([^"]+)[" ]?[^>]*>/ig,"\n[img]$1[/img]\n");    str = str.replace(/<object[^>]*?6BF52A52\-394A\-11d3\-B153\-00C04F79FAA6[^>]*?>.*<param[^>]+name\s*=\s*["](url|src)["][^>]+value=[" ]?([^"]+)[" ][^>]*>.*<\/object>/ig,"\n[wmv]$2[/wmv]\n");     str = str.replace(/<object[^>]*?D27CDB6E\-AE6D\-11cf\-96B8\-444553540000[^>]*?>.*<param[^>]+name\s*=\s*["](url|src)["][^>]+value=[" ]?([^"]+)[" ][^>]*>.*<\/object>/ig,"\n[swf]$2[/swf]\n");    str = str.replace(/<embed[^>]*type=["]?application\/x\-shockwave\-flash["]?[^>]*src=[" ]?([^"|^ ]+)[" ]?[^>]*>/ig,"\n[swf]$1[/swf]\n");    str = str.replace(/<embed[^>]*src=["]?([^"|^ ]+)["]?[^>]*type=["]?application\/x\-shockwave\-flash["]?[^>]*>/ig,"\n[swf]$1[/swf]\n");    str = str.replace(/<object[^>]*?CFCDAA03\-8BE4\-11cf\-B84B\-0020AFBBCCFA[^>]*?>.*<param[^>]+name\s*=\s*["](url|src)["][^>]+value=[" ]?([^"]+)[" ][^>]*>.*<\/object>/ig,"\n[rm]$2[/rm]\n");     str = str.replace(/<([\/]?)b>/ig,"[$1b]");    str = str.replace(/<([\/]?)strong>/ig,"[$1b]");    str = str.replace(/<([\/]?)u>/ig,"[$1u]");    str = str.replace(/<([\/]?)i>/ig,"[$1i]");    str = str.replace(/&nbsp;/g," ");    str = str.replace(/&amp;/g,"&");    str = str.replace(/&quot;/g,"\"");    str = str.replace(/&lt;/g,"<");    str = str.replace(/&gt;/g,">");    str = str.replace(/<br>/ig,"\n");    str = str.replace(/<p[^>]*?>/ig,"\n\n");    str = str.replace(/<[^>]*?>/g,"");    str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");    str = str.replace(/\n+/g,"\n");    try{    extraCheck(4);    document.getElementById("e_textarea").value = str;    document.getElementById("e_iframe").contentWindow.document.body.innerHTML = html;        if(lb!="err"){        document.getElementById("typeid").options[0].value = lb;        document.getElementById("typeid").value = lb;    }    document.getElementById("postsubmit").click();    }catch(err){alert(err.message);}}

Application: http://files.cnblogs.com/tao8825529/%E8%BD%AC%E5%B8%96%E5%B7%A5%E5%85%B7.rar

 

 

If you have other better suggestions or find a program bug, add QQ Group 45311550 for discussion!

 

Original article, reposted, please indicate the author

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.