From c84215091e914c81937c3aad2f1fd1775f556aa6 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sun, 21 Mar 2021 17:37:13 -0600 Subject: Changes from procedural to OOP --- index.php | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 900918b..6c1c0c9 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ cflip.net forum - +

Welcome to the cflip.net forum!

@@ -24,35 +24,34 @@ id == $b->id) { + return 0; + } + return ($a->id < $b->id) ? -1 : 1; } - if (mysqli_num_rows($result) == 0) { - echo 'No categories found!'; - } else { - while ($row = mysqli_fetch_assoc($result)) { - echo ' - - ' . $row['cat_name'] . ' -
- ' . $row['cat_description'] . ' - - ' . $row['cat_thread_count'] . ' - ' . $row['cat_post_count'] . ' - my supercool thread
by cflip, 3 days ago - -'; - } + $categories = get_all_categories($dbc); + usort($categories, "cmp"); + + foreach ($categories as $category) { + echo ''; + echo ''; + echo '' . $category->name . ''; + echo '
' . $category->description; + echo ''; + echo '' . $category->thread_count . ''; + echo '' . $category->post_count . ''; + echo 'my supercool thread
by cflip, 3 days ago'; + echo ''; } ?>

More from the forum

- +
-- cgit v1.2.3
Recent Posts Recent Threads