PDA

View Full Version : No more Thread too long messages! How to get the last 10 posts in the reply window


10-15-2000, 01:33 PM
Tiny tiny hack! However I know some newbies may wanted to have this coded a long time ago on their forum

In the file newreply.php (under the action="newreply" section)

if ($DB_site->num_rows($posts)>$maxposts) {
eval("\$threadreviewbits = \"".gettemplate("threadreview")."\";");
} else {
while ($post=$DB_site->fetch_array($posts)) {
$username=$post[username];
$reviewmessage=bbcodeparse($post[pagetext],$forumid,$post[allowsmilie]);

eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
}
}


And replace with

$i = 1;
while ($post=$DB_site->fetch_array($posts) and $i<=10) {
$username=$post[username];
$reviewmessage=bbcodeparse($post[pagetext],$forumid,$post[allowsmilie]);

eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
$i++;
}


You can set $i equal to the amount of posts you want to see. So far no bugs since this is such a tiny addition! :) Hope some people like this

[Edited by SonnetCelestial on 10-15-2000 at 10:36 AM]

10-15-2000, 02:00 PM
nice, i asked about this before, and was told the number of messages displayed on the reply window depends on the number of posts per thread page you set in the options panel.

So this looks great :)

10-15-2000, 02:04 PM
Thanks! :) I'm not sure if there are ways to make this more optimized, although 10 loops shouldn't be too stressful IMHO...

But do tell me if this effects your board in any way. I"ll try my best to fix it.