Customizable amount of threads per page. Fixed a bug, too.
This commit is contained in:
parent
67578b5b60
commit
aade2e720e
22
inc/html.php
22
inc/html.php
|
@ -275,25 +275,25 @@ EOF;
|
|||
function rebuildIndexes() {
|
||||
$page = 0; $i = 0; $htmlposts = '';
|
||||
$threads = allThreads();
|
||||
$pages = ceil(count($threads) / 10) - 1;
|
||||
$pages = ceil(count($threads) / TINYIB_THREADSPERPAGE) - 1;
|
||||
|
||||
foreach ($threads as $thread) {
|
||||
$replies = postsInThreadByID($thread['id']);
|
||||
|
||||
$htmlreplies = array();
|
||||
for ($j = min(count($replies) - 1, TINYIB_PREVIEWREPLIES); $j > 0; $j--) {
|
||||
$htmlreplies[$j] = buildPost($replies[$j], TINYIB_INDEXPAGE);
|
||||
}
|
||||
|
||||
$thread['omitted'] = max(count($replies) - TINYIB_PREVIEWREPLIES - 1, 0);
|
||||
$thread['omitted'] = max(0, count($replies) - TINYIB_PREVIEWREPLIES - 1);
|
||||
|
||||
$htmlposts .= buildPost($thread, TINYIB_INDEXPAGE) . implode('', $htmlreplies) . "<br clear=\"left\">\n<hr>";
|
||||
$htmlposts .= buildPost($thread, TINYIB_INDEXPAGE);
|
||||
|
||||
for ($j = count($replies) - 1; $j > $thread['omitted']; $j--) {
|
||||
$htmlposts .= buildPost($replies[$j], TINYIB_INDEXPAGE);
|
||||
}
|
||||
|
||||
$htmlposts .= "<br clear=\"left\">\n<hr>";
|
||||
|
||||
if (++$i == 10) {
|
||||
if (++$i >= TINYIB_THREADSPERPAGE) {
|
||||
$file = ($page == 0) ? 'index.html' : $page . '.html';
|
||||
writePage($file, buildPage($htmlposts, 0, $pages, $page));
|
||||
|
||||
$page += 1; $i = 0; $htmlposts = '';
|
||||
$page++; $i = 0; $htmlposts = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ define('TINYIB_TRIPSEED', ""); // Enter some random text - Used when generating
|
|||
define('TINYIB_ADMINPASS', ""); // Text entered at the manage prompt to gain administrator access
|
||||
define('TINYIB_MODPASS', ""); // Moderators only have access to delete posts ["" to disable]
|
||||
define('TINYIB_DBMODE', "flatfile"); // Choose: flatfile / mysql / sqlite
|
||||
define('TINYIB_PREVIEWREPLIES', 0); // Max replies to show on index
|
||||
define('TINYIB_PREVIEWREPLIES', 3); // Max replies to show on index
|
||||
define('TINYIB_THREADSPERPAGE', 10); // Amount of threads per page on index
|
||||
|
||||
// Note: The following only apply when TINYIB_DBMODE is set to mysql
|
||||
define('TINYIB_DBHOST', "localhost");
|
||||
|
|
Loading…
Reference in New Issue