diff options
Diffstat (limited to 'includes/functions_inc.php')
-rw-r--r-- | includes/functions_inc.php | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/includes/functions_inc.php b/includes/functions_inc.php deleted file mode 100644 index c10b65b..0000000 --- a/includes/functions_inc.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -function display_threads($dbc, $sql_result, $show_category = false) { - $sql = "SELECT post_id, post_date, user_id, user_name FROM posts JOIN users ON post_author = user_id WHERE post_thread = ? ORDER BY post_id DESC LIMIT 1"; - $stmt = mysqli_stmt_init($dbc); - - if (!mysqli_stmt_prepare($stmt, $sql)) { - die('Could not create thread due to internal error: ' . mysqli_error($dbc)); - } - - while ($row = mysqli_fetch_assoc($sql_result)) { - mysqli_stmt_bind_param($stmt, "i", $row['thread_id']); - mysqli_stmt_execute($stmt); - - $thread_res = mysqli_stmt_get_result($stmt); - $thread = mysqli_fetch_assoc($thread_res); - - echo '<tr><td class="left">'; - echo '<h4><a href="thread.php?id=' . $row['thread_id'] . '">' . $row['thread_subject'] . '</a></h4>'; - echo '<small>by <b><a href="user.php?id=' . $row['user_id'] . '">' . $row['user_name'] . '</a></b> '; - if ($show_category) { - echo 'in <b><a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a></b> '; - } - echo 'on ' . date('M d, Y', strtotime($row['thread_date'])) . '</small>'; - echo '</td><td class="right">by <b><a href="user.php?id=' . $thread['user_id'] . '">' . $thread['user_name'] . '</a></b><br>'; - echo '<small>' . date('m/d/Y g:ia', strtotime($thread['post_date'])) . '</small></td></tr>'; - } - - mysqli_stmt_close($stmt); -}
\ No newline at end of file |