1 Star 0 Fork 0

陈正/bbs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
quote.php 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
cz 提交于 2021-10-04 07:09 . 帖子展示
<?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>&nbsp;&gt;&nbsp;引用帖子回复
</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'); ?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen_zhengs/bbs.git
git@gitee.com:chen_zhengs/bbs.git
chen_zhengs
bbs
bbs
master

搜索帮助