summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/.htaccess0
-rw-r--r--includes/db_inc.php2
-rw-r--r--includes/functions_display.php14
3 files changed, 4 insertions, 12 deletions
diff --git a/includes/.htaccess b/includes/.htaccess
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/includes/.htaccess
diff --git a/includes/db_inc.php b/includes/db_inc.php
index 2d157af..7d743fc 100644
--- a/includes/db_inc.php
+++ b/includes/db_inc.php
@@ -2,7 +2,7 @@
$db_server = 'localhost';
$db_user = 'root';
-$db_pass = '';
+$db_pass = 'admin';
$db_database = 'forum2';
$dbc = mysqli_connect($db_server, $db_user, $db_pass, $db_database);
diff --git a/includes/functions_display.php b/includes/functions_display.php
index 479648f..bf9ed64 100644
--- a/includes/functions_display.php
+++ b/includes/functions_display.php
@@ -86,14 +86,9 @@ function add_quote($dbc, $thread_id, $matches) {
}
}
-function display_posts($dbc, $sql_result) {
- echo '<table>';
- $post_index = 1;
- $thread_id = $_GET['id'];
-
+function display_posts($dbc, $thread_id, $sql_result) {
while ($row = mysqli_fetch_assoc($sql_result)) {
- echo '<tr><th></th><th>' . $post_index . '</th></tr>';
- echo '<tr class="post" id=' . $post_index . '><td>Posted by <a href="user.php?id='. $row['user_id'] .'">' . $row['user_name'] . '</a><br><small>' . date('m/d/Y g:ia', strtotime($row['post_date'])) . '</small></td>';
+ echo '#' . $row['post_id'] . ' Posted by <a href="user.php?id='. $row['user_id'] .'">' . $row['user_name'] . '</a> on ' . date('m/d/Y g:ia', strtotime($row['post_date'])) . '<br>';
$post_content = $row['post_content'];
@@ -110,9 +105,6 @@ function display_posts($dbc, $sql_result) {
// Replace other URLs with links.
$post_content = preg_replace('@\b(http(s)?://)([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:</\w+>|/?>))@i', '<a href="http$2://$3">$0</a>', $post_content);
- echo '<td class="post-content">' . $post_content . '</td></tr>';
-
- $post_index++;
+ echo $post_content;
}
- echo '</table>';
} \ No newline at end of file