关于网站会员投稿的问题,一直在dede论坛找答案,问了很久也没人理我,最后还是自己研究出来了。大家看一下,我测试通过了。
修改文件:./plus/view.php
头部添加:
|
查看源码
打印代码帮助
|
|
01 |
require_once(DEDEINC.'/memberlogin.class.php'); |
|
02 |
$keeptime = isset($keeptime) && is_numeric($keeptime) ? $keeptime : -1; |
|
03 |
$name_chka = new MemberLogin($keeptime); |
|
04 |
在view.php末尾$arc->Display();前添加: |
|
05 |
|
|
06 |
if($name_chka->M_UserName != $arc->Fields['writer']) |
|
07 |
{ |
|
08 |
$description = "只有本人才能查看"; |
|
09 |
$pubdate = GetDateTimeMk($arc->Fields["pubdate"]); |
|
10 |
$arctitle = $arc->Fields['title']; |
|
11 |
$msgtitle = "没有权限!"; |
|
12 |
$moremsg = "<font color='red'>请登录后查看!</font>"; |
|
13 |
include_once($cfg_basedir.$cfg_templets_dir."/plus/view_msg.htm"); |
|
14 |
$arc->Close(); |
|
15 |
exit(); |
|
16 |
} |