如果只是要求游客可以看的话, 删除 info.php 里面的
//是否公开
if($ac=='cp'||$ac=='post')
{
checklogin();//需要登录
这个代码就可以了。
不过还需要做一些后续的处理.. 要不, 是游客都可以发 可以删除 可以编辑游客发布的信息.
给你举个例子:
修改:info_cp.php
找到
//事件feed
$fs = array();
$fs['icon'] = '1004186';
$fs['title_template'] = "{actor}发布了新的分类信息 <b>{subject}</b>";
修改成: //事件feed
$fs = array();
$fs['icon'] = '1004186';
$fs['title_template'] = "<!--{if $info[username]}-->{actor}<!--{else}-->游客<!--{/if}-->发布了新的分类信息 <b>{subject}</b>";
还有后面的回复的事件自己对照的改就是了..
修改view文件夹里的info_view文件
找到
<!--{if $_SGLOBAL[supe_uid] == $info['uid']}-->
<a href="info.php?do=info&ac=post&id=$id&op=edit">编辑信息</a><span class="pipe">|</span>
<a href="info.php?do=info&ac=cp&id=$id&op=delete" id="blog_delete_$blog[blogid]" onclick="return confirm('确定删除吗?')">删除</a>
<!--{elseif $_SGLOBAL[supe_uid] == ADMIN_ID }-->
<a href="info.php?do=info&ac=cp&id=$id&op=delete" id="blog_delete_$blog[blogid]" onclick="return confirm('确定删除吗?')">删除</a>
<!--{/if}-->
修改成:
<!--{if $_SGLOBAL[supe_username]}-->
<!--{if $_SGLOBAL[supe_uid] == $info['uid']}-->
<a href="info.php?do=info&ac=post&id=$id&op=edit">编辑信息</a><span class="pipe">|</span>
<a href="info.php?do=info&ac=cp&id=$id&op=delete" id="blog_delete_$blog[blogid]" onclick="return confirm('确定删除吗?')">删除</a>
<!--{elseif $_SGLOBAL[supe_uid] == ADMIN_ID }-->
<a href="info.php?do=info&ac=cp&id=$id&op=delete" id="blog_delete_$blog[blogid]" onclick="return confirm('确定删除吗?')">删除</a>
<!--{/if}-->
<!--{else}--> 此信息为开放式信息。本站不确保其真实性!
<!--{/if}-->
限制游客回复:
修改view文件夹里的info_view
找到<form action="info.php?do=info&ac=cp&op=finish" onsubmit="return checkForm()" method="post">
<!--{loop $reply $value}-->
<div style="color:#999999; padding:4px; margin:0px; text-align:left; border:1px dotted #ccc">
<table width="560" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100"><div align="center">
<div class="avatar48" align="left"><a href="space.php?uid=$value[uid]"><img src="<!--{avatar($value[uid],small)}-->" alt="$value[username]" class="avatar" /></a></div><a href="space.php?uid=$value[uid]" id="author_$value[id]">$value[username]</a><br> <span class="time"><!--{date('Y-m-d H:i',$value[dateline],1)}--></span>
<br>
<!--{if $value[uid]==$_SGLOBAL[supe_uid] && false }-->
<a href="info.php" id="c_$value[id]_edit" onclick="ajaxmenu(event, this.id, 99999, '', -1)">编辑</a>
<!--{/if}-->
<!--{if $_SGLOBAL[supe_uid]==ADMIN_ID }-->
<a href="info.php?do=info&ac=cp&op=replydelete&info_id={$info[id]}&id=$value[id]" id="c_$value[id]_delete" onclick="return confirm('确定删除吗?')">删除</a>
<!--{/if}--></div></td>
<td <!--{if $value[score] > 0 }-->width="400"<!--{/if}--> valign="top"><font color="#FF0000">$value[username]留言:</font><br>$value[content]
</td>
<!--{if $value[score] > 0 }-->
<td width="60" valign="top"><table width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="info/css/win.gif" width="50" height="43" /></div></td>
</tr>
<tr>
<td><div align="center"><font color="#006600"><strong>获分value[score]</strong></font></div></td>
</tr>
</table>
</td>
<!--{/if}-->
</tr>
</table>
</div> <br>
<!--{/loop}-->
<!--{if count($reply) > 0 }-->
<!--{if $info[status] == 1 && $info[uid]==$_SGLOBAL[supe_uid] }-->
<input type="submit" id="submit_btn" name="submit_btn" class="submit" value="结束" />
<!--{elseif $info[status] == 2 }-->
<span >此分类已经结束: $info[msg] </span>
<!--{/if}-->
<!--{/if}-->
<input type="hidden" name="info_id" id="info_id" value="$info[id]" />
<input type="hidden" name="theurl" value="$theurl" />
</form>
<br>
<form id="commentform" name="commentform" action="info.php?do=info&ac=cp&op=reply" method="post" class="quickpost">
<table cellpadding="0" cellspacing="0">
<tr>
<td><textarea id="comment_message" name="content" rows="5" onkeydown="ctrlEnter(event, 'reply_submit_btn');"></textarea></td>
</tr>
<tr>
<td>
<input type="hidden" name="refer" value="$theurl" />
<input type="hidden" name="info_id" value="$info_id">
<input type="hidden" name="info_title" value="$info[title]" />
<input type="hidden" name="info_uid" value="$info[uid]" />
<input type="button" id="reply_submit_btn" name="reply_submit_btn" class="submit" value="留言" onclick="ajaxpost('commentform', 'comment_status', 'reply_reload')" />
<span id="comment_status"></span>
</td>
</tr>
</table>
</form>
在前面加一个判断就可以了:
<!--{if $_SGLOBAL[supe_username]}-->
<form action="info.php?do=info&ac=cp&op=finish" onsubmit="return checkForm()" method="post">
<!--{loop $reply $value}-->
<div style="color:#999999; padding:4px; margin:0px; text-align:left; border:1px dotted #ccc">
<table width="560" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100"><div align="center">
<div class="avatar48" align="left"><a href="space.php?uid=$value[uid]"><img src="<!--{avatar($value[uid],small)}-->" alt="$value[username]" class="avatar" /></a></div><a href="space.php?uid=$value[uid]" id="author_$value[id]">$value[username]</a><br> <span class="time"><!--{date('Y-m-d H:i',$value[dateline],1)}--></span>
<br>
<!--{if $value[uid]==$_SGLOBAL[supe_uid] && false }-->
<a href="info.php" id="c_$value[id]_edit" onclick="ajaxmenu(event, this.id, 99999, '', -1)">编辑</a>
<!--{/if}-->
<!--{if $_SGLOBAL[supe_uid]==ADMIN_ID }-->
<a href="info.php?do=info&ac=cp&op=replydelete&info_id={$info[id]}&id=$value[id]" id="c_$value[id]_delete" onclick="return confirm('确定删除吗?')">删除</a>
<!--{/if}--></div></td>
<td <!--{if $value[score] > 0 }-->width="400"<!--{/if}--> valign="top"><font color="#FF0000">$value[username]留言:</font><br>$value[content]
</td>
<!--{if $value[score] > 0 }-->
<td width="60" valign="top"><table width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="info/css/win.gif" width="50" height="43" /></div></td>
</tr>
<tr>
<td><div align="center"><font color="#006600"><strong>获分value[score]</strong></font></div></td>
</tr>
</table>
</td>
<!--{/if}-->
</tr>
</table>
</div> <br>
<!--{/loop}-->
<!--{if count($reply) > 0 }-->
<!--{if $info[status] == 1 && $info[uid]==$_SGLOBAL[supe_uid] }-->
<input type="submit" id="submit_btn" name="submit_btn" class="submit" value="结束" />
<!--{elseif $info[status] == 2 }-->
<span >此分类已经结束: $info[msg] </span>
<!--{/if}-->
<!--{/if}-->
<input type="hidden" name="info_id" id="info_id" value="$info[id]" />
<input type="hidden" name="theurl" value="$theurl" />
</form>
<br>
<form id="commentform" name="commentform" action="info.php?do=info&ac=cp&op=reply" method="post" class="quickpost">
<table cellpadding="0" cellspacing="0">
<tr>
<td><textarea id="comment_message" name="content" rows="5" onkeydown="ctrlEnter(event, 'reply_submit_btn');"></textarea></td>
</tr>
<tr>
<td>
<input type="hidden" name="refer" value="$theurl" />
<input type="hidden" name="info_id" value="$info_id">
<input type="hidden" name="info_title" value="$info[title]" />
<input type="hidden" name="info_uid" value="$info[uid]" />
<input type="button" id="reply_submit_btn" name="reply_submit_btn" class="submit" value="留言" onclick="ajaxpost('commentform', 'comment_status', 'reply_reload')" />
<span id="comment_status"></span>
</td>
</tr>
</table>
</form>
<!--{else}-->游客不允许回复{!--{/if}--> |