Пример #1
0
        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';
Пример #2
0
$webcontent->add_data('<br>');
if (isset($_SESSION['userid'])) {
    $webcontent->add_data('<a link="write" name=' . $boardid . ' cate=0>' . 发表文章 . '</a> ');
    $webcontent->add_data('| <a link="write" name=' . $boardid . ' cate=1>' . 发表议题 . '</a> ');
}
if ($_SESSION['rank'] >= 8) {
    $webcontent->add_data('| <a id="setboard">管理板块</a> ');
}
$sqline = $db->query("select count(*) from board_admin where board='{$boardid}'")->fetch();
$total = intval($sqline[0]);
$offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0;
$sqline = $db->query("select * from board_admin where board='{$boardid}' order by date DESC limit {$offset},10 ")->fetchAll();
foreach ($sqline as $row) {
    \SECURE\kill_html($row['title']);
    \SECURE\kill_html($row['labels']);
    \SECURE\kill_html($row['content']);
    \SECURE\_short($row['content']);
    $result = $db->query("select username from user where id={$row['author_id']}")->fetch();
    $row['content'] = preg_replace("/\\n/", "<br>", $row['content']);
    $webcontent->add_data('<div class="dataitem articleinfo" ' . ($row['checks'] > 100 ? 'hot' : '') . '><a item link="article" id=' . $row['id'] . '>' . $row['title'] . '</a><p>' . $row['content'] . '</p>');
    $webcontent->add_data('<p iteminfo><a user link="user" id=' . $row['author_id'] . '>' . $result['username'] . '</a> 发表于 ' . $row['date'] . " 被赞{$row['favor']}次 回复{$row['comment']} 查看{$row['checks']}</p></div>");
}
if ($total > 10) {
    $_GET['page'] = intval($_GET['page']);
    for ($i = 0; $i < $total / 10 && $i < 7; $i++) {
        if ($_GET['page'] >= 3) {
            if ($i + $_GET['page'] >= $total / 10) {
                break;
            }
            if ($i + $_GET['page'] == $_GET['page']) {
                $webcontent->add_data('<a class="pagechange chosen">' . ($i + $_GET['page'] + 1) . '</a>');
Пример #3
0
}
$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) {