コード例 #1
0
ファイル: posts.php プロジェクト: eaglewei/ecustoj
function draw_post_tree($parent)
{
    //不绘制自身
    $buff = '';
    $query = 'select discuss_info.*, LENGTH(discuss_info.content) as content_len, users.name ' . 'from discuss_info inner join users on discuss_info.user_id=users.user_id ' . "where discuss_info.topic_id={$parent['message_id']} and discuss_info.message_id<>{$parent['message_id']} " . 'order by discuss_info.reply_id desc ';
    $ret = oj_query($query);
    if ($row = mysql_fetch_assoc($ret)) {
        $buff = $buff . '<ul>';
        do {
            $buff = $buff . '<li>' . draw_single_post($row, 0) . draw_post_tree($row) . '</li>';
        } while ($row = mysql_fetch_assoc($ret));
        $buff = $buff . '</ul>';
    }
    return $buff;
}
コード例 #2
0
ファイル: bbs.php プロジェクト: eaglewei/ecustoj
    $bbs_pro_id = intval($_GET['pro_id']);
    $query = $query . "and discuss_info.pro_id={$bbs_pro_id} ";
}
if (isset($_GET['top'])) {
    $bbs_top = intval($_GET['top']);
    $query = $query . "and reply_id<{$bbs_top} ";
}
$query = $query . 'order by reply_id desc ';
$ret = oj_query($query);
$bbs_count = 0;
$bbs_last_reply = 0;
$bbs_first_reply = 0;
while ($row = mysql_fetch_assoc($ret)) {
    echo '<li>';
    echo draw_single_post($row);
    echo draw_post_tree($row);
    echo '<hr/></li>';
    if ($bbs_first_reply == 0) {
        $bbs_first_reply = $row['reply_id'];
    }
    $bbs_last_reply = $row['reply_id'];
    if ($bbs_count >= $bbs_limit) {
        break;
    }
}
?>
</ul>
</td></tr>
</table>
<center>
<?php