Fields['mid']" to obtain mid; 3. Use If determines the mid, non-contributing users and administrators can prohibit viewing."/> Fields['mid']" to obtain mid; 3. Use If determines the mid, non-contributing users and administrators can prohibit viewing.">
Home > Article > CMS Tutorial > How does the Dream Weaver system prohibit dynamic browsing of unaudited documents?
How does the Dreamweaver system prohibit dynamic browsing of unaudited documents
Dreamweaver DedeCms is released by members by default Unreviewed documents can be browsed dynamically (/plus/view.php?aid=xxx). After submission, you can browse dynamically, and Baidu will also include it normally.
The default method of the Dedecms system will undoubtedly bring about many minor problems, such as:
1. Users submit a large number of junk documents and are included, resulting in a decrease in site authority;
2. It brings great inconvenience to the daily management and maintenance of the webmaster/administrator;
3. It brings a bad access experience to front-end users;
4 , other unimaginable situations, etc.;
We can modify the code to achieve the following effects: When a user-submitted document is in a pending review state, only the submitting user or administrator can view it, and other users None can be viewed.
1) Modification method
Edit and open the /plus/view.php file (note: this file is a dynamic browsing file for the document) and find the following code:
//检查阅读权限 $needMoney = $arc->Fields['money']; $needRank = $arc->Fields['arcrank'];
Add the following code to the next line:
$mid = $arc->Fields['mid']; if(($cfg_ml->M_Rank < 1 || $mid <> $cfg_ml->M_ID) && $needRank == -1){ showMsg("你无查看权限",-1); exit(); }
Save and close.
2) Effect preview
Recommended tutorial: dedecms tutorial
The above is the detailed content of How does the Dream Weaver system prohibit dynamic browsing of unaudited documents?. For more information, please follow other related articles on the PHP Chinese website!