All pastes #587003 Raw Edit

Miscellany

public text v1 · immutable
#587003 ·published 2007-06-24 05:53 UTC
rendered paste body
function commentDisp($row, $level) {

$userid = $row["userid"];

$sql = "SELECT username FROM users WHERE userid='$userid'";

$username = mysql_fetch_array(mysql_query($sql));
?>

<div style="margin-right: 50px; height: 15px; background-color: #C9C9C9; margin-top: 15px; margin-left: <?php echo 300 + 50 * $level; ?>px; padding: 5px;">
<p style="color: #444444; font-size: .75em;">
Posted by: <a href="/profile/viewprofile.php?userid=<?php echo $userid; ?>"><?php echo $username["username"]; ?></a>
|
Posted on: <?php echo $row["timestamp"]; ?>
</p></div>
<div style="border: 1px solid #C9C9C9; margin: 0px; margin-right: 50px; margin-left: <?php echo 300 + 50 * $level; ?>px; padding: 5px;">
<p style="font-size: .75em;"><?php echo $row["body"]; ?></p></div>

<?php
}

$sql = "SELECT commid,userid,body,timestamp FROM comments WHERE propid='$propid' AND parent='0'";

$commQuery = mysql_query($sql);

echo "<p style=\"margin-top: 30px; margin-left: 300px;
        font-weight: bold; text-decoration: underline;\">
        Discussion &amp; Critique</p>";

while ($row = mysql_fetch_array($commQuery)) {

commentDisp($row, 0);

$commid = $row["commid"];

$sql = "SELECT commid,userid,body,timestamp FROM comments WHERE parent='$commid'";

$subCommQuery = mysql_query($sql);


        while ($row = mysql_fetch_array($subCommQuery)) {

        commentDisp($row, 1);

        }


}


?>