'; } $qpost = mysqli_query($gcon, "SELECT * FROM f_Posts WHERE parentid='" . $threadid . "' ORDER BY id ASC"); $posts = array(); while($x = mysqli_fetch_array($qpost)) { $posts[$x['id']] = $x; } $posts_sort = array(); foreach($posts as $y) { array_push($posts_sort, $y); } if(count($posts_sort) > 10) { echo makePageSwitcher($posts_sort); } $post_page = pagify($posts_sort); echo formatPost($post_page[0], array_slice($post_page, 1)); for($i = 1; $i < count($post_page) - 1; $i++) { if($post_page[$i]['authorid'] == $post_page[$i - 1]['authorid']) { $i++; continue; } echo formatPost($post_page[$i], array_slice($post_page, $i + 1)); } if(count($post_page) > 1) { echo formatPost($post_page[count($post_page) - 1]); } if(count($posts_sort) > 10) { echo makePageSwitcher($posts_sort); } if(isset($_SESSION['account']) and $_SESSION['acctype'] !== 'new') { echo ''; } else { echo '
A petponies.com account is required to post. You can register here.
'; } } else { echo 'Error 404
404 - Thread not found. Try to be less terrible at links from now on.
'; } } else { if($view !== null) { if($view['type'] == 'normal') { $qchildren = mysqli_query($gcon, "SELECT * FROM f_Threads AS t JOIN f_Posts as p ON p.id = t.lastid WHERE t.parentid='" . $boardid . "' ORDER BY p.date_posted DESC"); echo 'Threads
';
$threads = array();
while($x = mysqli_fetch_array($qchildren)) {
array_push($threads, $x);
}
if(checkPermSet($view['perm_post'])) {
echo '';
}
if(count($threads) > 20) {
echo makePageSwitcher($threads);
}
$thread_page = pagify($threads, 20);
if(count($threads) == 0) {
echo 'It's so empty in here. I'm scared. Hold me.
'; } foreach($thread_page as $cthread) { $qlp = mysqli_query($gcon, "SELECT * FROM f_Posts WHERE id='" . $cthread['lastid'] . "'"); $qop = mysqli_query($gcon, "SELECT * FROM f_Posts WHERE id='" . $cthread['opid'] . "'"); $qnp = mysqli_query($gcon, "SELECT * FROM f_Posts WHERE parentid='" . $cthread[0] . "'"); $lp = mysqli_fetch_array($qlp); $op = mysqli_fetch_array($qop); $qlu = mysqli_query($gcon, "SELECT * FROM Accounts WHERE id='" . $lp['authorid'] . "'"); $lu = mysqli_fetch_array($qlu); $qou = mysqli_query($gcon, "SELECT * FROM Accounts WHERE id='" . $op['authorid'] . "'"); $ou = mysqli_fetch_array($qou); echo '' . $cthread['title'] . '';
echo '
' . stripBBCode($op['text']) . '
' . PHP_EOL;
echo '' . stripBBCode($op['text']) . '
| Replies | Started By | Last Poster | Last Post |
|---|---|---|---|
| ' . (mysqli_num_rows($qnp) - 1) . ' | ' . $ou['name'] . ' | ' . $lu['name'] . ' | ' . convertLocalTime($lp['date_posted'], $_SESSION['timezone'], true) . ' |
' . $csboard['title'] . '';
echo '
' . $csboard['description'] . '
' . PHP_EOL;
echo '' . $csboard['description'] . '
| Threads | Last Poster | Last Post |
|---|---|---|
| ' . mysqli_num_rows($qnt) . ' | ' . $slu . ' | ' . $slp . ' |
' . $cboard['title'] . '';
echo '
' . $cboard['description'] . '
' . PHP_EOL;
echo '' . $cboard['description'] . '
| Threads | Last Poster | Last Post |
|---|---|---|
| ' . mysqli_num_rows($qnt) . ' | ' . $slu . ' | ' . $slp . ' |
Error 404
404 - Board not found. Try to be less terrible at links from now on.
'; } } ?>