代码拉取完成,页面将自动刷新
<?php
include_once('inc/config.php');
include_once('inc/mysql.inc.php');
include_once('inc/tool.inc.php');
include_once('inc/page.inc.php');
$link = connect();
$template['title'] = '帖子引用回复页';
$template['css'] = array('static/style/public.css', 'static/style/reply.css');
if(!$_COOKIE['name']){
skip('login.php','error','请先登录');
}
if(!isset($_GET['cid'])&&!is_numeric($_GET['cid'])){
skip('son_module_list.php','error','请求数据不合法');
}
//查询帖子详情
$sqlC = "select * from bbs_content where id = {$_GET['cid']}";
$resC = execute($link,$sqlC);
$dataC = mysqli_fetch_assoc($resC);
//查询楼数
$sqlFl = "select count(*) from bbs_reply where content_id = {$dataC['id']} and reply_id <= {$_GET['rid']}";
$floor = num($link,$sqlFl);
//查询被引用回复详情
$sqlQuote = "select r.*,m.name,m.id mid from bbs_reply r,bbs_member m where r.reply_id = {$_GET['rid']} and m.id = r.member_id";
$resQuote = execute($link,$sqlQuote);
$dataQuote = mysqli_fetch_assoc($resQuote);
if($_POST){
//插入回复信息
$sqlAdd = "insert into bbs_reply(content_id,quote_id,info,time,member_id) values({$dataC['id']},{$dataQuote['reply_id']},'{$_POST['content']}','".time()."',{$_COOKIE['id']})";
$resAdd = execute($link,$sqlAdd);
if(mysqli_affected_rows($link) == 1){
skip('show.php?id='.$dataC['id'],'ok','引用回复成功');
}else{
skip($_SERVER['REQUEST_URI'],'error','数据有误,请联系管理员');
}
}
?>
<?php include_once('public/head.php'); ?>
<div id="position" class="auto">
<i><img src="static/images/home.png" alt=""></i><a href="index.php">首页</a> > 引用帖子回复
</div>
<div class="publish">
<div><?php echo $dataQuote['name'];?>:<?php echo $dataC['title'];?></div>
<div class="quote">
<div class="title">
引用<?php echo $floor;?>楼<?php echo $dataQuote['name'];?>发表的:
</div>
内容:<?php echo $dataQuote['info'];?>
</div>
<form action="" method="post">
<textarea name="content" id="" cols="30" rows="10" class="content"></textarea>
<input type="submit" name="submit" class="reply" value="">
</form>
</div>
<?php include_once('public/foot.php'); ?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。