網教程 關于網站會員投稿的問題,一直在dede論壇找答案,問了很久也沒人理我,最后還是自己研究出來了。大家看一下,我測試通過了。
修改文件:./plus/view.php
頭部添加:
require_once(DEDEINC.'/memberlogin.class.php'); $keeptime = isset($keeptime) && is_numeric($keeptime) ? $keeptime : -1; $name_chka = new MemberLogin($keeptime); |
在view.php末尾$arc->Display();前添加:
if($name_chka->M_UserName != $arc->Fields['writer']) { $description = "只有本人才能查看"; $pubdate = GetDateTimeMk($arc->Fields["pubdate"]); $arctitle = $arc->Fields['title']; $msgtitle = "沒有權限!"; $moremsg = "<font color='red'>請登錄后查看!</font>"; include_once($cfg_basedir.$cfg_templets_dir."/plus/view_msg.htm"); $arc->Close(); exit(); } |