return; } } $articleid = $_GET['articleid']; $webcontent = new template(); $webcontent->set_title("极端讨论区"); $webcontent->set_subtitle('Welcome to a place of pure boredness.'); $webcontent->helloword(); $webcontent->add_rely("default.css"); $webcontent->add_rely("animation.js"); $webcontent->add_rely("interact.js"); $webcontent->add_rely("favor.js"); $sqline = $db->query("select * from relation where object={$_SESSION['userid']}")->fetchAll(); $webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>关注列表</div></div><div class="data">'); $webcontent->add_data('<h4>你关注的人</h4>'); foreach ($sqline as $value) { $userinfo = $db->query("select * from user where id={$value['subject']}")->fetch(); $webcontent->add_data('<div style="display:inline-block"><img infoheadpic src="http://www.gravatar.com/avatar/' . md5($userinfo['email']) . '?s=128"><a link="user" id=' . $userinfo['id'] . '><h5>' . $userinfo['username'] . '</h5></a></div>'); } $webcontent->add_data('<br><br><h4>你关注的回复</h4>'); $sqline = $db->query("select * from comment_favor_data where user_id={$_SESSION['userid']}")->fetchAll(); foreach ($sqline as $value) { $userinfo = $db->query("select * from board_admin_c where id={$value['comment_id']}")->fetch(); \SECURE\kill_html($userinfo['title']); \SECURE\kill_html($userinfo['content']); \SECURE\_format($userinfo['content']); $webcontent->add_data('<div class="dataitem"><h3><a link="article" id=' . $userinfo['article_index'] . '>' . $userinfo['title'] . '</a></h3>' . $userinfo['content'] . '关注于' . $value['time'] . ' <a cid="' . $value['comment_id'] . '" class="cancelf">取消关注</a></div>'); } $webcontent->add_data('<br><br>'); $webcontent->add_data('</div></div>'); include_once './blade.php';
$webcontent->add_data("<p id='articleid' style='display:none;'>{$articleid}</p>"); $webcontent->add_data("<div class='dataitem' style='min-height:400px;font-size:18px;line-height:1.5'><p>{$sqline['content']}</p></div>"); //遵循先看文后看人原则 if ($article_cate == 0) { $webcontent->add_data('<br><div class="author"><div class="left"><img infoheadpic src="http://www.gravatar.com/avatar/' . md5($result['email']) . '?s=128"></div>'); $webcontent->add_data('<h3><a link="user" id=' . $sqline['author_id'] . '>' . $result['username'] . '</a></h3><br><p iteminfo>' . ($result['rank'] == '9' ? '管理员' : $result['rank']) . '<br>' . $result['sign'] . '</p> 发表于 ' . $sqline['date'] . ' 被赞' . $sqline['favor'] . '次 回复' . $sqline['comment'] . ' 查看' . $sqline['checks'] . '</div><br><br>'); } $webcontent->add_data('</div></div>'); $webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec gry></span><div navi-top-bar>评论</div></div><div class="data" id="commentboard">'); $sqline = $db->query("select count(*) from board_admin_c where article_index={$articleid}")->fetch(); $total = intval($sqline[0]); $sqline = $db->query("select * from board_admin_c where article_index={$articleid} order by time DESC limit 7")->fetchAll(); foreach ($sqline as $value) { \SECURE\kill_html($value['title']); \SECURE\kill_html($value['content']); \SECURE\_format($value['content']); $result = $db->query("select username from user where id={$value['author_id']}")->fetch(); $part = $db->query("select count(*) from comment_favor_data where comment_id={$value['id']}")->fetch(); $favor = "<a>有{$part[0]}人觉得很赞</a>"; if (isset($_SESSION['userid'])) { $favordata = $db->query("select * from comment_favor_data where user_id={$_SESSION['userid']} and comment_id={$value['id']}")->fetchAll(); if (count($favordata) == 0) { $favor = "<a class='favor' name='{$value['id']}'>赞({$part[0]})</a>"; } else { $favor = "<a class='chosen'>已赞({$part[0]})</a>"; } } $webcontent->add_data('<div class="dataitem comment"><h3>' . $value['title'] . '</h3><h5>' . $value['content'] . '</h5><p iteminfo><a user link="user" id=' . $value['author_id'] . '>' . $result['username'] . '</a> 发表于' . $value['time'] . ' ' . $favor . ' <a class="atat">@我</a></p></div>'); } if ($total > 7) { for ($i = 0; $i <= $total / 7; $i++) {